new ScreenSpaceEventHandler
Handles user input events. Custom functions can be added to be executed on when the user enters input.
Parameters:
| Name | Type | Description |
|---|---|---|
element |
DOC_TBA | The element to add events to. Defaults to document. |
Methods
-
destroy
-
Removes listeners held by this object.
Once an object is destroyed, it should not be used; calling any function other thanisDestroyedwill result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.Throws:
DeveloperError : This object was destroyed, i.e., destroy() was called.Returns:
Example
handler = handler && handler.destroy();
-
getInputAction
-
Returns the function to be executed on an input event.
Parameters:
Name Type Description typeEnumeration The ScreenSpaceEventType of input event. modifierEnumeration A KeyboardEventModifier key that is held when a typeevent occurs.Throws:
DeveloperError : type is required. -
isDestroyed
-
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 a DeveloperError exception.Returns:
Booleantrueif this object was destroyed; otherwise,false. -
removeInputAction
-
Removes the function to be executed on an input event.
Parameters:
Name Type Description typeEnumeration The ScreenSpaceEventType of input event. modifierEnumeration A KeyboardEventModifier key that is held when a typeevent occurs.Throws:
DeveloperError : type is required. -
setInputAction
-
Set a function to be executed on an input event.
Parameters:
Name Type Description actionFunction Function to be executed when the input event occurs. typeEnumeration The ScreenSpaceEventType of input event. modifierEnumeration A KeyboardEventModifier key that is held when a typeevent occurs.Throws:
-
DeveloperError : action is required.
-
DeveloperError : type is required.
-
