When this is false, the context menu will be prevented from opening if there is a binding to the right mouse button.
When disabled, no binding events will fire.
Event emitter for binding press events. The original mouse or key event will be passed as an argument.
The HTMLElement that inputs
is bound to.
Optional filter function. Useful if you want to, e.g., ignore a key binding if ctrl/alt are pressed, but allow that same binding if it originated from a mouse event.
Numeric counters representing accumulated pointer/scroll inputs
since the last time tick
was called.
How many times each binding has been pressed
since the last time tick
was called.
When true, all key events with bindings will call preventDefaults
.
How many times each binding has been released
since the last time tick
was called.
The boolean state of whether each binding is currently pressed.
inputs.state['move-left'] // true if a bound key is pressed
When true, all key events with bindings will call stopPropagation
.
Event emitter for binding release events. The original mouse or key event will be passed as an argument.
Generated using TypeDoc
noa.inputs
- Handles key and mouse input bindings.This module extends game-inputs, so turn on "Inherited" to see its APIs here, or view the base module for full docs.
This module uses the following default options (from the options object passed to the Engine):