API Reference

Class List

ElementInput

Handles mouse and touch events for ElementComponents. When input events occur on an ElementComponent this fires the appropriate events on the ElementComponent.

Summary

Methods

addElement

Add a ElementComponent to the internal list of ElementComponents that are being checked for input.

attach

Attach mouse and touch events to a DOM element.

detach

Remove mouse and touch events from the DOM element that it is attached to.

removeElement

Remove a ElementComponent from the internal list of ElementComponents that are being checked for input.

Details

Constructor

ElementInput(domElement, [options])

Create a new ElementInput instance.

Parameters

domElementElement

The DOM element.

optionsobject

Optional arguments.

options.useMouseboolean

Whether to allow mouse input. Defaults to true.

options.useTouchboolean

Whether to allow touch input. Defaults to true.

options.useXrboolean

Whether to allow XR input sources. Defaults to true.

Methods

addElement(element)

Add a ElementComponent to the internal list of ElementComponents that are being checked for input.

Parameters

elementElementComponent

The ElementComponent.

attach(domElement)

Attach mouse and touch events to a DOM element.

Parameters

domElementElement

The DOM element.

detach()

Remove mouse and touch events from the DOM element that it is attached to.

removeElement(element)

Remove a ElementComponent from the internal list of ElementComponents that are being checked for input.

Parameters

elementElementComponent

The ElementComponent.