zerk.game.engine.system.control.keyboard Class
Keyboard Interface
Provides methods to handle keyboard inputs.
Item Index
Methods
Properties
Methods
_onKeyDown
-
event
Key down event handler
Parameters:
-
event
DOMEventDOM event
_onKeyPress
-
event
Key press event handler
Parameters:
-
event
DOMEventDOM event
_onKeyUp
-
event
Key up event handler
Parameters:
-
event
DOMEventDOM event
fireEvent
-
event
Fire event
Parameters:
-
event
StringEvent name
Returns:
on
-
event
-
callback
-
scope
Register event handler
Parameters:
-
event
StringEvent name
-
callback
FunctionCallback function. Return false to cancel event bubble.
-
scope
ObjectScope to be used in callback function
un
-
event
-
callback
Unregister event handler
Parameters:
-
event
StringEvent name
-
callback
FunctionCallback function
Returns:
Properties
_eventListeners
Array
protected
List of event handlers
_keyMap
Object
protected
Key map
pressedAlt
Boolean
State of the alt key
pressedArrowDown
Boolean
State of the arrow down key
pressedArrowLeft
Boolean
State of the arrow left key
pressedArrowRight
Boolean
State of the arrow right key
pressedArrowUp
Boolean
State of the arrow up key
pressedBackspace
Boolean
State of the backspace key
pressedCapsLock
Boolean
State of the capslock key
pressedCtrl
Boolean
State of the ctrl key
pressedEnd
Boolean
State of the end key
pressedEnter
Boolean
State of the enter key
pressedEscape
Boolean
State of the escape key
pressedHome
Boolean
State of the home key
pressedPageDown
Boolean
State of the pagedown key
pressedPageUp
Boolean
State of the pageup key
pressedPause
Boolean
State of the pause key
pressedShift
Boolean
State of the shift key
pressedSpace
Boolean
State of the space key
pressedTab
Boolean
State of the tab key
Events
keypress
Fires when a key is pressed
Event Payload:
-
event
DOMEvent
keyup
Fires when a key is released
Event Payload:
-
event
DOMEvent