Keybind

Methods
6
Fields
None

Getting one

Keybind.new(…)

Methods

MethodReturnsDescription
matches(AwtKeyEvent)booleanWhether e is this keybind being pressed (or, for a KEY_RELEASED event, released).
getKeyCode()numberThe AWT key code; KeyEvent.VK_UNDEFINED for a modifier-only keybind.
getModifiers()numberThe extended modifier mask.
toString()stringNot set, Ctrl, Ctrl+Shift+F1.
new(number, number)Keybind(number, number) -> Keybind: A keybind of AWT key code keyCode and extended modifiers modifiers, normalised (a modifier key as the co…
new(AwtKeyEvent)Keybind
getModifierForKeyCode(number)number?The modifier mask a modifier key's code is (KeyEvent.VK_SHIFT is InputEvent.SHIFT_DOWN_MASK), or nil for any other key.

Returned by

MethodReturnsDescription
KeybindClass.newKeybind(number, number) -> Keybind: A keybind of AWT key code keyCode and extended modifiers modifiers, normalised (a modifier key as the co…

Method details

matches

matches: (Keybind, AwtKeyEvent) -> boolean

Whether e is this keybind being pressed (or, for a KEY_RELEASED event, released).

getKeyCode

getKeyCode: (Keybind) -> number

The AWT key code; KeyEvent.VK_UNDEFINED for a modifier-only keybind.

new

new: ((number, number) -> Keybind) & ((AwtKeyEvent) -> Keybind)

(number, number) -> Keybind: A keybind of AWT key code keyCode and extended modifiers modifiers, normalised (a modifier key as the code becomes a modifier-only keybind).

(AwtKeyEvent) -> Keybind: The keybind of the key event e: its key code and modifiers.

getModifierForKeyCode

getModifierForKeyCode: (number) -> number?

The modifier mask a modifier key's code is (KeyEvent.VK_SHIFT is InputEvent.SHIFT_DOWN_MASK), or nil for any other key.