Keyboard Class
Keyboard instance for input in sync with the running application, internally stores the key transitions provided by the browser.
Allow to detect every key press, release event in sync with the app frame update.
The keyboard object provided by scripts is automatically updated by the runtime handler.
Item Index
Methods
dispose
()
Create keyboard events.
dispose
()
Dispose keyboard events.
keyJustPressed
()
Boolean
Check is a key as just pressed.
Returns:
True is the key was just pressed
keyJustReleased
()
Boolean
Check if a key was just released.
Returns:
True is the key was just pressed
keyPressed
()
Boolean
Check if a key is pressed.
Returns:
True is the key is currently pressed
reset
()
Reset keyboard status to default.
Does not clean the action list.
update
()
Update key flags synchronously.
Properties
actions
Array
The actions array serves as a buffer for the key input actions.
Until the update method is called it stores all the key stroke actions.
On update the key strokes are updated and the keys array stores the correct values.
events
EventManager
Event manager used to handle the keyup, keydown and focus events.
On each event actions are added to the actions array.
keys
Array
Array with keyboard keys status.