Class gui.KeyboardHandler
Defined in: KeyboardHandler.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
<static> |
gui.KeyboardHandler.KeyCode
|
<static> |
gui.KeyboardHandler.Modifier
|
Method Attributes | Method Name and Description |
---|---|
bind(keyCode, modifiers, callback, overwrite)
Bind to the specified keycode + modifiers.
|
|
<inner> |
getKeyCombo(keyCode, modifiers)
|
<inner> |
getModifiers(e)
|
handleEvent(e)
|
|
setDefault(callback)
|
|
unbind(keyCode, modifiers)
|
Field Detail
<static>
gui.KeyboardHandler.KeyCode
<static>
gui.KeyboardHandler.Modifier
Method Detail
bind(keyCode, modifiers, callback, overwrite)
Bind to the specified keycode + modifiers. To bind directly to one of the modifiers, simply
pass in the modifier as the keyCode (e.g., Keycode.Ctrl), and set the modifiers to Modifier.None.
This class will take care of binding to the appropriate modifiers to ensure the keybinding works as
expected.
- Parameters:
- {!number} keyCode
- {!number} modifiers
- {!Function} callback
- {boolean=} overwrite
- Set to true to force a binding to be overwritten
<inner>
{!string}
getKeyCombo(keyCode, modifiers)
- Parameters:
- {!number} keyCode
- {!number} modifiers
- Returns:
- {!string}
<inner>
{!number}
getModifiers(e)
- Parameters:
- {!KeyboardEvent} e
- Returns:
- {!number}
handleEvent(e)
- Parameters:
- {!KeyboardEvent} e
setDefault(callback)
- Parameters:
- {?Function} callback
unbind(keyCode, modifiers)
- Parameters:
- {!number} keyCode
- {!number} modifiers