Private
buttonPrivate
disabledReadonly
eventsPrivate
finishedWhether the last touch event has finished before disabling
Private
Readonly
inputBinds a node to a specific key to simulate keyboard events on touch.
The DOM element to bind the key to.
The key to simulate.
This function binds touch events to a node to simulate 'keydown' and 'keyup' keyboard events. It adds the key to the keys map and tracks the keydown state. When a touch starts, it simulates a 'keydown' event and adds an 'active' class to the node. When the touch ends, it simulates a 'keyup' event, removes the keydown state, and removes the 'active' class from the node and the last touched element.
Deactivates all currently pressed keys.
Disable touch controls
Enable touch controls
Initialize touch controls by binding keys to buttons.
https://stackoverflow.com/a/39778831/4622620|Source
Prevent zoom on specified element
Simulates a keyboard event on the canvas if the button is not disabled.
The type of the keyboard event ('keydown' or 'keyup').
The key to simulate.
Whether the simulation was successful.
Whether touch controls are disabled