Skip to content

Enum Keysym ​

An xkb keysym, the symbol a key produces. Get one from the Key table or a KeyEvent.

lua
local quit_key = Key.Escape
local name = tostring(quit_key)
local same = Key.escape == quit_key

Values ​

Key.<name> -> KeysymKey.<name> ​

The keysym with this xkb name, such as Key.Return, Key.a, Key.F1, Key.KP_Add or Key.XF86AudioRaiseVolume.

  • Names ignore case. When that matches two keysyms the lowercase one wins: Key.A is a, and Key.f1 is F1.
  • To match a shifted letter, compare event.raw_key with the lowercase key and check event.modifiers.shift.

Errors for an unknown name.

Operators ​

keysym == other -> booleankeysym == other ​

True when both are the same keysym.

  • Lua only calls this when both sides are userdata, so keysym == "a" and keysym == 97 are always false. Compare names with tostring(keysym) == "a".

tostring(keysym) -> stringtostring ​

The xkb name, such as "Return" or "A".

keysym .. value -> stringkeysym .. value ​

The name joined with value turned into text, on either side: "key " .. Key.Return is "key Return".