Event object passed to all pointer interaction event handlers.
This interface defines the standardized event payload that all interactive objects
emit. It provides access to the event type, the interaction handler that generated
the event, and selection state information when applicable.
Cross-Platform Support: These events work consistently across all pointer input
types (mouse, touch, pen) thanks to the underlying PointerEvent implementation.
functionhandlePointerInteraction(e: ThreeMouseEvent<string>) { // Event type is always available console.log(`Event: ${e.type}`); // 'click', 'over', 'select', etc.
// Access to the interaction handler (if available) if (e.interactionHandler) { console.log(`Value: ${e.interactionHandler.value}`); console.log(`Enabled: ${e.interactionHandler.enable}`); }
// Selection state (for checkboxes and radio buttons) if (e.isSelected !== undefined) { console.log(`Selected: ${e.isSelected}`); } }
// Works for mouse clicks, touch taps, and pen interactions clickableMesh.interactionHandler.on('click', handlePointerInteraction);
Remarks
All properties are readonly to prevent accidental modification
interactionHandler may be undefined in some contexts
isSelected is only meaningful for checkbox and radio button events
The event object is created by ThreeMouseEventUtil.generate()
Despite the "Mouse" naming, supports all pointer input types (mouse, touch, pen)
Event object passed to all pointer interaction event handlers.
This interface defines the standardized event payload that all interactive objects emit. It provides access to the event type, the interaction handler that generated the event, and selection state information when applicable.
Cross-Platform Support: These events work consistently across all pointer input types (mouse, touch, pen) thanks to the underlying PointerEvent implementation.
Example
Remarks
interactionHandler
may be undefined in some contextsisSelected
is only meaningful for checkbox and radio button eventsSee