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.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
canvas |
HTMLCanvasElement |
document
|
可选 The element to handle events for. |
成员(属性)
Gets whether any mouse button is down, a touch has started, or the wheel has been moved.
currentMousePosition : Cartesian2
Gets the current mouse position.
方法
Removes mouse listeners held by this object.
Once an object is destroyed, it should not be used; calling any function other than
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.
使用示例:
handler = handler && handler.destroy();
参考:
Gets the time the button was pressed or the touch was started.
参数名称 | 类型 | 描述信息 |
---|---|---|
type |
CameraEventType | The camera event type. |
modifier |
KeyboardEventModifier | 可选 The keyboard modifier. |
返回值:
The time the button was pressed or the touch was started.
Gets the time the button was released or the touch was ended.
参数名称 | 类型 | 描述信息 |
---|---|---|
type |
CameraEventType | The camera event type. |
modifier |
KeyboardEventModifier | 可选 The keyboard modifier. |
返回值:
The time the button was released or the touch was ended.
Gets the start and end position of the last move event (not the aggregated event).
参数名称 | 类型 | 描述信息 |
---|---|---|
type |
CameraEventType | The camera event type. |
modifier |
KeyboardEventModifier | 可选 The keyboard modifier. |
返回值:
Gets the aggregated start and end position of the current event.
参数名称 | 类型 | 描述信息 |
---|---|---|
type |
CameraEventType | The camera event type. |
modifier |
KeyboardEventModifier | 可选 The keyboard modifier. |
返回值:
getStartMousePosition(type, modifier) → Cartesian2
Gets the mouse position that started the aggregation.
参数名称 | 类型 | 描述信息 |
---|---|---|
type |
CameraEventType | The camera event type. |
modifier |
KeyboardEventModifier | 可选 The keyboard modifier. |
返回值:
The mouse position.
Gets whether the mouse button is down or a touch has started.
参数名称 | 类型 | 描述信息 |
---|---|---|
type |
CameraEventType | The camera event type. |
modifier |
KeyboardEventModifier | 可选 The keyboard modifier. |
返回值:
Whether the mouse button is down or a touch has started.
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than
If this object was destroyed, it should not be used; calling any function other than
isDestroyed
will result in a DeveloperError
exception.
返回值:
true
if this object was destroyed; otherwise, false
.
Gets if a mouse button down or touch has started and has been moved.
参数名称 | 类型 | 描述信息 |
---|---|---|
type |
CameraEventType | The camera event type. |
modifier |
KeyboardEventModifier | 可选 The keyboard modifier. |
返回值:
Returns
true
if a mouse button down or touch has started and has been moved; otherwise, false
Signals that all of the events have been handled and the aggregator should be reset to handle new events.