new ScreenSpaceEventHandler(elementopt)
Handles user input events. Custom functions can be added to be executed on
when the user enters input.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
element |
Canvas |
<optional> |
document | The element to add events to. |
- Source:
Members
(static) mouseEmulationIgnoreMilliseconds
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
- Source:
Methods
destroy() → {undefined}
Removes listeners held by this object.
Once an object is destroyed, it should not be used; calling any function other than
Once an object is destroyed, it should not be used; calling any function other than
isDestroyed
will result in a DeveloperError
exception. Therefore,
assign the return value (undefined
) to the object as done in the example.
Throws:
-
This object was destroyed, i.e., destroy() was called.
- Type
- DeveloperError
Returns:
- Type
- undefined
Example
handler = handler && handler.destroy();
getInputAction(type, modifieropt)
Returns the function to be executed on an input event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
Number | The ScreenSpaceEventType of input event. | |
modifier |
Number |
<optional> |
A KeyboardEventModifier key that is held when a type
event occurs. |
- Source:
- See:
isDestroyed() → {Boolean}
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than
If this object was destroyed, it should not be used; calling any function other than
isDestroyed
will result in a DeveloperError
exception.
Returns:
true
if this object was destroyed; otherwise, false
.
- Type
- Boolean
removeInputAction(type, modifieropt)
Removes the function to be executed on an input event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
Number | The ScreenSpaceEventType of input event. | |
modifier |
Number |
<optional> |
A KeyboardEventModifier key that is held when a type
event occurs. |
- Source:
- See:
setInputAction(action, type, modifieropt)
Set a function to be executed on an input event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | Function to be executed when the input event occurs. | |
type |
Number | The ScreenSpaceEventType of input event. | |
modifier |
Number |
<optional> |
A KeyboardEventModifier key that is held when a type
event occurs. |