Members
(static, constant) ALT :number
- Source:
Constant for the alt key
Type:
- number
(static, constant) BACKSPACE :number
- Source:
Constant for the backspace key
Type:
- number
(static, constant) CAPS_LOCK :number
- Source:
Constant for the caps lock key
Type:
- number
(static, constant) CTRL :number
- Source:
Constant for the control key
Type:
- number
(static, constant) DOWN :number
- Source:
Constant for the down arrow key
Type:
- number
(static, constant) ENTER :number
- Source:
Constant for the enter key
Type:
- number
(static, constant) LEFT :number
- Source:
Constant for the left arrow key
Type:
- number
(static, constant) LEFT_COMMAND :number
- Source:
Constant for the left command key
Type:
- number
(static, constant) LEFT_WINDOW :number
- Source:
Constant for the left window key
Type:
- number
(static, constant) nonEditingKeys :Array.<number>
- Source:
Modifiers and keys that don't produce or change input.
Type:
- Array.<number>
(static, constant) RIGHT :number
- Source:
Constant for the right arrow key
Type:
- number
(static, constant) RIGHT_COMMAND :number
- Source:
Constant for the right command key
Type:
- number
(static, constant) RIGHT_WINDOW :number
- Source:
Constant for the right windowkey
Type:
- number
(static, constant) SELECT :number
- Source:
Constant for the select key
Type:
- number
(static, constant) SHIFT :number
- Source:
Constant for the shift key
Type:
- number
(static, constant) SPACE :number
- Source:
Constant for the space key
Type:
- number
(static, constant) TAB :number
- Source:
Constant for the tab key
Type:
- number
(static, constant) UP :number
- Source:
Constant for the up arrow key
Type:
- number
Methods
(static) digit(digit) → {number}
- Source:
Get the keyboard code for a numeric digit.
Example
const code3 = Keyboard.digit(3);
Parameters:
Name | Type | Description |
---|---|---|
digit |
number | The number value to be converted to key code. |
Returns:
Key code corresponding to digit.
- Type
- number
(static) isEditingKey(keyCode) → {boolean}
- Source:
Check if a key is an editing key.
Parameters:
Name | Type | Description |
---|---|---|
keyCode |
number | Key code corresponding to key pressed. |
Returns:
Whether or not the key is an editing key.
- Type
- boolean
(static) letter(letter) → {number}
- Source:
Get the keyboard code for a character.
Only to be used with single-character strings.
Example
const aCode = Keyboard.letter("a");
Parameters:
Name | Type | Description |
---|---|---|
letter |
string | The letter to be converted to key code. |
Returns:
Key code corresponding to letter.
- Type
- number