Class: ScreenSpaceEventHandler

ScreenSpaceEventHandler

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.

See:
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
type Number optional

Enter the ScreenSpaceEventType of the event.

modifier Number optional

The key of KeyboardEventModifier held when the type event occurs.

See:

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.

See:
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
type Number optional

Enter the ScreenSpaceEventType of the event.

modifier Number optional

The key of KeyboardEventModifier held when the type event occurs.

See:

setInputAction(action, type, modifier)

Set the function to be executed on the input event.

Name Type Description
action function optional

The function to be executed when an input event occurs.

type Number optional

Enter the ScreenSpaceEventType of the event.

modifier Number optional

The key of KeyboardEventModifier held when the type event occurs.

See: