new ScreenSpaceEventHandler(element)
Handle user input events. Custom functions can be added to execute upon user input.
| Name | Type | Default | Description |
|---|---|---|---|
element |
Canvas | document |
optional
To add elements of an event. |
Members
-
static mouseEmulationIgnoreMilliseconds
-
The amount of time (in milliseconds) that a mouse event will be disabled after receiving any touch event, so that any simulated mouse events will be ignored.
- Default Value: 800
Methods
-
destroy(){undefined}
-
Once an object is destroyed, it should not be called if the listener held by this object is removed; Calling any function other than isDestroyed will result in a Developer Error exception. Therefore, assign the return value (undefined) to the object.
Throws:
-
The object was destroyed by calling destroy().
- Type
- DeveloperError
Returns:
Type Description undefined Example
handler = handler && handler.destroy(); -
-
getInputAction(type, modifier)
-
Return the function to be executed on the input event.
Name Type Description typeNumber optional Enter the ScreenSpaceEventType of the event.
modifierNumber optional The key of KeyboardEventModifier held when the type event occurs.
-
isDestroyed(){Boolean}
-
If this object is destroyed, return true; otherwise, return false. If this object is damaged, it should not be used; Calling any function other than isDestroyed will result in a Developer Error exception.
Returns:
Type Description Boolean If this object is destroyed, it is true; otherwise, it is false. -
removeInputAction(type, modifier)
-
Delete the function to be executed on the input event.
Name Type Description typeNumber optional Enter the ScreenSpaceEventType of the event.
modifierNumber optional The key of KeyboardEventModifier held when the type event occurs.
-
setInputAction(action, type, modifier)
-
Set the function to be executed on the input event.
Name Type Description actionfunction optional The function to be executed when an input event occurs.
typeNumber optional Enter the ScreenSpaceEventType of the event.
modifierNumber optional The key of KeyboardEventModifier held when the type event occurs.