[page:EventDispatcher] →

[name]

Abstract base class for controls.

Constructor

[name]( [param:Object3D object], [param:HTMLDOMElement domElement] )

[page:Object3D object] - The object the controls should manage (usually the camera).

[page:HTMLDOMElement domElement]: The HTML element used for event listeners. (optional)

Creates a new instance of [name].

Properties

[property:HTMLDOMElement domElement]

The HTML element used for event listeners. If not provided via the constructor, [page:.connect]() must be called after `domElement` has been set.

[property:Boolean enabled]

When set to `false`, the controls will not respond to user input. Default is `true`.

[property:Object keys]

This object defines the keyboard input of the controls. Default is `{}`.

[property:Object mouseButtons]

This object defines what type of actions are assigned to the available mouse buttons. It depends on the control implementation what kind of mouse buttons and actions are supported. Default is `{ LEFT: null, MIDDLE: null, RIGHT: null }`.

Possible buttons are: `LEFT`, `MIDDLE`, `RIGHT`.

Possible actions are defined in the [page:Core Constants] page.

[property:Object3D object]

The 3D object that is managed by the controls.

[property:Integer state]

The internal state of the controls. Default is `-1` (`NONE`).

[property:Object touches]

This object defines what type of actions are assigned to what kind of touch interaction. It depends on the control implementation what kind of touch interaction and actions are supported. Default is `{ ONE: null, TWO: null }`.

Possible buttons are: `ONE`, `TWO`.

Possible actions are defined in the [page:Core Constants] page.

Methods

See the base [page:EventDispatcher] class for common methods.

[method:undefined connect] ()

Connects the controls to the DOM. This method has so called "side effects" since it adds the module's event listeners to the DOM.

[method:undefined disconnect] ()

Disconnects the controls from the DOM.

[method:undefined dispose] ()

Call this method if you no longer want use to the controls. It frees all internal resources and removes all event listeners.

[method:undefined update] ( [param:Number delta] )

Controls should implement this method if they have to update their internal state per simulation step.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]