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