Class that tracks user input for a given DOM element and outputs an object of type Input to the InputObservable, that can be acquired through the function InputManager.getInputObservable();
The input manager will automatically attach itself to the 'document' and listen for any and all key presses, but one may set it to listen for key presses on a specific DOM element.
Kind: global class
Attaches InputManager to a given DOMElement, or if none is passed, attaches it to entire document.
| Param | Type | Description |
|---|---|---|
| DOMElement | Node |
the desired element |
| bindings | Object |
map of key values to an array of actions etc) |
Toggles whether inputs are emitted;
Kind: instance method of Manager
Starts session and timer. Turns on both emissions and recording, if not already on. Assumes song timer is at zero.
Kind: instance method of Manager
Terminates session and returns array of action events recorded.
Kind: instance method of Manager
Returns: Array.<ActionEvent> - all action events recorded.
Pauses recording and timer, if session is ongoing.
Kind: instance method of Manager
Resumes recording and timer, if session is ongoing.
Kind: instance method of Manager
Returns the action observable. Subscribe to this observable to handle actions.
Kind: instance method of Manager
Clears subscriptions to clear memory.
Kind: instance method of Manager
Deprecated
Kind: instance method of Manager
| Param | Type | Description |
|---|---|---|
| key | String |
the value of a key as defined in https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values |
| action | String |
to be bound to key |
Binds an array of actions to a given key. WARNING: this will erase all previous bindings.
Kind: instance method of Manager
| Param | Type | Description |
|---|---|---|
| key | String |
the value of a key as defined in https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values |
| action | String |
an array of actions to be bound |