Private
buttonPrivate
inputThe 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.
https://stackoverflow.com/a/39778831/4622620|Source
Prevent zoom on specified element
Simulates a keyboard event on the canvas.
The type of the keyboard event ('keydown' or 'keyup').
The key to simulate.
This function checks if the key exists in the Button enum. If it does, it retrieves the corresponding button and emits the appropriate event ('input_down' or 'input_up') based on the event type.
Binds a node to a specific key to simulate keyboard events on touch.