[name]

A simple class for registering keyup/keydown events and identifying if a key is currently being pressed.

Constructor

[name]([page:HTMLDOMElement domElement])

[page:HTMLDOMElement domElement]: The HTML element to add event listeners to.

Properties

[property:Object isKeyDown]

An object whose keys are key codes from the [page:Keys] dictionary and values are boolean flags indicating if the corresponding key is currently being pressed.

[property:Function onKeyDown]

A callback triggered after the "keydown" event. Receives the "event" object as a parameter.

[property:Function onKeyUp]

A callback triggered after the "keyup" event. Receives the "event" object as a parameter.

Methods

[method:null dispose]()

Remove all the event listeners.
[sourceHint]