# ScreenSpaceEventHandler

#### new Cesium.ScreenSpaceEventHandler(element)
Core/ScreenSpaceEventHandler.js 690

Handles user input events. Custom functions can be added to be executed on when the user enters input.

Name | Type | Default | Description
--- | --- | --- | ---
`element` | HTMLCanvasElement | `document` | optional The element to add events to.

### Members

#### static Cesium.ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds : Number
Core/ScreenSpaceEventHandler.js 832

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`

#### static Cesium.ScreenSpaceEventHandler.touchHoldDelayMilliseconds : Number
Core/ScreenSpaceEventHandler.js 840

The amount of time, in milliseconds, before a touch on the screen becomes a touch and hold.

Default Value: `1500`

### Methods

#### destroy()
Core/ScreenSpaceEventHandler.js 820

Removes listeners held by this object.
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:

- DeveloperError : This object was destroyed, i.e., destroy() was called.

##### Example:

    handler = handler && handler.destroy();

##### See:

- ScreenSpaceEventHandler#isDestroyed

#### getInputAction(type, modifier) → function
Core/ScreenSpaceEventHandler.js 759

Returns the function to be executed on an input event.

Name | Type | Description
--- | --- | ---
`type` | Number | The ScreenSpaceEventType of input event.
`modifier` | Number | optional A KeyboardEventModifier key that is held when a `type` event occurs.

##### Returns:

The function to be executed on an input event.

##### See:

- ScreenSpaceEventHandler#setInputAction
- ScreenSpaceEventHandler#removeInputAction

#### isDestroyed() → Boolean
Core/ScreenSpaceEventHandler.js 801

Returns true if this object was destroyed; otherwise, false.
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`.

##### See:

- ScreenSpaceEventHandler#destroy

#### removeInputAction(type, modifier)
Core/ScreenSpaceEventHandler.js 780

Removes the function to be executed on an input event.

Name | Type | Description
--- | --- | ---
`type` | Number | The ScreenSpaceEventType of input event.
`modifier` | Number | optional A KeyboardEventModifier key that is held when a `type` event occurs.

##### See:

- ScreenSpaceEventHandler#getInputAction
- ScreenSpaceEventHandler#setInputAction

#### setInputAction(action, type, modifier)
Core/ScreenSpaceEventHandler.js 733

Set a function to be executed on an input event.

Name | Type | 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.

##### See:

- ScreenSpaceEventHandler#getInputAction
- ScreenSpaceEventHandler#removeInputAction