- Source
Example
// Check if the key with the keycode 65 (A) is pressed
KeyboardInput.IsKeyDown(KeyBoardInput.KEY_CODE.A);Methods
(static) dispose()
Remove global handlers and forget every held key. Safe to call repeatedly.
- Source
(static) GetSpecialKeyPressed() → {number}
Returns the keycode of the special key pressed.
- Source
Returns:
The keycode of the special key pressed.
- Type:
- number
(static) IsKeyDown(keyCode) → {boolean}
Checks if the key with the given keycode is pressed.
Parameters:
| Name | Type | Description |
|---|---|---|
keyCode | KeyboardInput. | The keycode of the key to check. |
- Source
Returns:
True if the key with the given keycode is pressed.
- Type:
- boolean
Example
KeyboardInput.IsKeyDown(KeyboardInput.KEY_CODE.A)(static) IsKeyPressed()
True for the simulation frame after a key goes down, even after a quick release.
- Source
(static) IsKeyReleased()
True for a simulation frame after a key goes up, including a quick tap.
- Source
(static) reset()
Clear held and transient state when a gameplay or project context ends.
- Source