Static
disableStatic
enableStatic
getStatic
registerRegisters input handlers for a specific input handling state.
This method associates a set of input event handlers with a particular state. When the state becomes active, these handlers will be automatically attached to their respective DOM elements.
The input handling state to register handlers for
Array of input handler information objects
Static
setSets the active state of a specific input handling state.
This method controls whether the input handlers for a particular state should be active or inactive. When set to active, the corresponding event listeners will be attached. When set to inactive, they will be removed.
Special handling is implemented for gizmo states - activating one gizmo state will automatically deactivate the other to prevent conflicts.
The input handling state to modify
Whether the state should be active (true) or inactive (false)
Static
unregisterUnregisters and deactivates input handlers for a specific input handling state.
This method removes all event handlers associated with the specified state and marks the state as inactive. All event listeners will be removed from their respective DOM elements.
The input handling state to unregister
Manages input event handling across different states in the Rhodonite engine.
This class provides a centralized way to manage input events for different interaction modes such as camera control, gizmo manipulation, etc. It automatically handles adding and removing event listeners based on the current active state, ensuring that only the appropriate input handlers are active at any given time.
The InputManager uses a state-based approach where different input handling states (like camera control or gizmo manipulation) can be registered with their respective event handlers. The manager then activates/deactivates these handlers based on the current application state.
Example