Handles user input events. Custom functions can be added to be executed on
when the user enters input.
| Name | Type | Default | Description |
|---|---|---|---|
element |
Canvas |
document
|
optional The element to add events to. |
Members
-
The amount of time, in milliseconds, that mouse events will be disabled after receiving any touch events, such that any emulated mouse events will be ignored.
-
Default Value:
800
Methods
-
Removes listeners held by this object.
Once an object is destroyed, it should not be used; calling any function other thanisDestroyedwill result in aDeveloperErrorexception. Therefore, assign the return value (undefined) to the object as done in the example.Returns:
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
handler = handler && handler.destroy();See:
-
-
Returns the function to be executed on an input event.
Name Type Description typeNumber The ScreenSpaceEventType of input event. modifierNumber optional A KeyboardEventModifier key that is held when a typeevent occurs. -
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other thanisDestroyedwill result in aDeveloperErrorexception.Returns:
trueif this object was destroyed; otherwise,false. -
Removes the function to be executed on an input event.
Name Type Description typeNumber The ScreenSpaceEventType of input event. modifierNumber optional A KeyboardEventModifier key that is held when a typeevent occurs. -
Set a function to be executed on an input event.
Name Type Description actionfunction Function to be executed when the input event occurs. typeNumber The ScreenSpaceEventType of input event. modifierNumber optional A KeyboardEventModifier key that is held when a typeevent occurs.
