CameraEventAggregator

external class CameraEventAggregator(canvas: HTMLCanvasElement? = definedExternally)(source)

Aggregates input events. For example, suppose the following inputs are received between frames: left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into one event with a start and end position of the mouse.

Parameters

canvas

The element to handle events for. Default value - document

See also

Constructors

Link copied to clipboard
constructor(canvas: HTMLCanvasElement? = definedExternally)

Properties

Link copied to clipboard

Gets whether any mouse button is down, a touch has started, or the wheel has been moved.

Link copied to clipboard

Gets the current mouse position.

Functions

Link copied to clipboard
fun destroy()

Removes mouse listeners held by this object.

Link copied to clipboard
fun getButtonPressTime(type: CameraEventType, modifier: KeyboardEventModifier? = definedExternally): Date

Gets the time the button was pressed or the touch was started.

Link copied to clipboard
fun getButtonReleaseTime(type: CameraEventType, modifier: KeyboardEventModifier? = definedExternally): Date

Gets the time the button was released or the touch was ended.

Link copied to clipboard
fun getLastMovement(type: CameraEventType, modifier: KeyboardEventModifier? = definedExternally): Any?

Gets the start and end position of the last move event (not the aggregated event).

Link copied to clipboard
fun getMovement(type: CameraEventType, modifier: KeyboardEventModifier? = definedExternally): Any

Gets the aggregated start and end position of the current event.

Link copied to clipboard
fun getStartMousePosition(type: CameraEventType, modifier: KeyboardEventModifier? = definedExternally): Cartesian2

Gets the mouse position that started the aggregation.

Link copied to clipboard
fun isButtonDown(type: CameraEventType, modifier: KeyboardEventModifier? = definedExternally): Boolean

Gets whether the mouse button is down or a touch has started.

Link copied to clipboard

Returns true if this object was destroyed; otherwise, false.

Link copied to clipboard
fun isMoving(type: CameraEventType, modifier: KeyboardEventModifier? = definedExternally): Boolean

Gets if a mouse button down or touch has started and has been moved.

Link copied to clipboard
fun reset()

Signals that all of the events have been handled and the aggregator should be reset to handle new events.