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 thanisDestroyed
will result inDeveloperError
abnormal. 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 type
Number optional Enter the ScreenSpaceEventType of the event. modifier
Number optional The key of the KeyboardEventModifier held when the type
event occurs. -
Returns true if this object is destroyed, otherwise false.
If this object is destroyed, it should not be used; calling any function other thanisDestroyed
will result inDeveloperError
Abnormal.Returns:
true
if the object was destroyed,false
otherwise. -
Removes the function to be executed on input events.
Name Type Description type
Number optional Enter the ScreenSpaceEventType of the event. modifier
Number optional The key of the KeyboardEventModifier held when the type
event occurs. -
Sets the function to be executed on input events.
Name Type Description action
function optional A function to execute when an input event occurs. type
Number optional Enter the ScreenSpaceEventType of the event. modifier
Number optional The key of the KeyboardEventModifier held when the type
event occurs.