Input Class
The static class that handles input data from the keyboard and gamepads.
Item Index
Methods- clear static
- initialize static
- isLongPressed static
- isPressed static
- isRepeated static
- isTriggered static
- update static
- date static
- dir4 static
- dir8 static
- gamepadMapper static
- keyMapper static
- keyRepeatInterval static
- keyRepeatWait static
Methods
clear () [static]
Clears all the input data.
initialize () [static]
Initializes the input system.
isLongPressed ( keyName ) Boolean [static]
Checks whether a key is kept depressed.
Parameters:
-
keyName
StringThe mapped name of the key
Returns:
Boolean:
True if the key is long-pressed
isPressed ( keyName ) Boolean [static]
Checks whether a key is currently pressed down.
Parameters:
-
keyName
StringThe mapped name of the key
Returns:
Boolean:
True if the key is pressed
isRepeated ( keyName ) Boolean [static]
Check if a key is just pressed or a key repeat occurred.
Parameters:
-
keyName
StringThe mapped name of the key
Returns:
Boolean:
True if the key is repeated
isTriggered ( keyName ) Boolean [static]
Checks whether a key is just pressed.
Parameters:
-
keyName
StringThe mapped name of the key
Returns:
Boolean:
True if the key is triggered
update () [static]
Updates the input data.
Properties
date Number [static]
[read-only] The time of the last input in milliseconds.
dir4 Number [static]
[read-only] The four direction value as a number of the numpad, or 0 for neutral.
dir8 Number [static]
[read-only] The eight direction value as a number of the numpad, or 0 for neutral.
gamepadMapper Object [static]
A hash table to convert from a gamepad button to a mapped key name.
keyMapper Object [static]
A hash table to convert from a virtual key code to a mapped key name.
keyRepeatInterval Number [static]
The interval of the key repeat in frames.
keyRepeatWait Number [static]
The wait time of the key repeat in frames.