new Keystroke( [cb] [, params])
UI Helper for capturing and handling keystrokes. cb to capture the key.
Developer is responsible for calling e.preventDefault() and/or e.stopPropagation();
Parameters:
Name | Type | Argument | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cb |
function |
<optional> |
Callback when key pressed |
||||||||||||
params |
object |
<optional> |
Properties
|
- Since:
-
8.5.0 Added
node
parameter.
Members
-
noKeyCapture :Boolean
-
Set this to true to bypass key capture. Shift, CTRL, CMD will still be toggled however.
Type:
- Boolean
Methods
-
keypress(e)
-
Identifies a keypress event.
Parameters:
Name Type Description e
KeyboardEvent -
mapKey(key)
-
Map command key values from keyboard to their internal values.
Note:
ctrl
andcmd
should only be used with care as they may conflict with browser and OS hotkeys.Parameters:
Name Type Description key
string Returns:
- Type
- string