Handles mouse and touch events for ElementComponents. When input events occur on an ElementComponent this fires the appropriate events on the ElementComponent.
new ElementInput(domElement: Element, options?: {
useMouse: boolean;
useTouch: boolean;
useXr: boolean;
}): ElementInput
Create a new ElementInput instance.
The DOM element.
Optional arguments.
boolean
Whether to allow mouse input. Defaults to true.
boolean
Whether to allow touch input. Defaults to true.
boolean
Whether to allow XR input sources. Defaults to true.
addElement(element: ElementComponent): void
Add a ElementComponent to the internal list of ElementComponents that are being checked for input.
The ElementComponent.
void
attach(domElement: Element): void
Attach mouse and touch events to a DOM element.
The DOM element.
void
detach(): void
Remove mouse and touch events from the DOM element that it is attached to.
void
removeElement(element: ElementComponent): void
Remove a ElementComponent from the internal list of ElementComponents that are being checked for input.
The ElementComponent.
void