聚合输入事件。例如,假设在帧之间接收到以下输入:鼠标左键按下、鼠标移动、鼠标移动、鼠标左键按下。这些事件将聚合为一个带有鼠标开始位置和结束位置的事件。 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.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
canvas |
HTMLCanvasElement |
document
|
可选 optional 处理事件的元素。 The element to handle events for. |
另见: See:
成员 Members
获取是否按下任何鼠标按钮、是否已开始触摸或是否已移动滚轮。 Gets whether any mouse button is down, a touch has started, or the wheel has been moved.
currentMousePosition : Cartesian2
获取当前鼠标位置。 Gets the current mouse position.
方法 Methods
删除该对象持有的鼠标侦听器。 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.
示例: Example:
handler = handler && handler.destroy();
另见: See:
获取按下按钮或开始触摸的时间。 Gets the time the button was pressed or the touch was started.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
type |
CameraEventType | 相机事件类型。 The camera event type. |
modifier |
KeyboardEventModifier | 可选 optional 键盘修改器。 The keyboard modifier. |
返回: Returns:
按下按钮或开始触摸的时间。 The time the button was pressed or the touch was started.
获取按钮被释放或触摸结束的时间。 Gets the time the button was released or the touch was ended.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
type |
CameraEventType | 相机事件类型。 The camera event type. |
modifier |
KeyboardEventModifier | 可选 optional 键盘修改器。 The keyboard modifier. |
返回: Returns:
释放按钮或触摸结束的时间。 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).
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
type |
CameraEventType | 相机事件类型。 The camera event type. |
modifier |
KeyboardEventModifier | 可选 optional 键盘修改器。 The keyboard modifier. |
返回: Returns:
获取当前事件的聚合开始和结束位置。 Gets the aggregated start and end position of the current event.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
type |
CameraEventType | 相机事件类型。 The camera event type. |
modifier |
KeyboardEventModifier | 可选 optional 键盘修改器。 The keyboard modifier. |
返回: Returns:
getStartMousePosition(type, modifier) → Cartesian2
获取开始聚合的鼠标位置。 Gets the mouse position that started the aggregation.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
type |
CameraEventType | 相机事件类型。 The camera event type. |
modifier |
KeyboardEventModifier | 可选 optional 键盘修改器。 The keyboard modifier. |
返回: Returns:
鼠标位置。 The mouse position.
获取鼠标按钮是否按下或触摸是否已开始。 Gets whether the mouse button is down or a touch has started.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
type |
CameraEventType | 相机事件类型。 The camera event type. |
modifier |
KeyboardEventModifier | 可选 optional 键盘修改器。 The keyboard modifier. |
返回: Returns:
鼠标按钮是否已按下或触摸是否已开始。 Whether the mouse button is down or a touch has started.
如果该对象被销毁则返回 true;否则为假。 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.
返回: Returns:
true 如果该物体被摧毁;否则, if this object was destroyed; otherwise, false.
另见: See:
获取鼠标按钮按下或触摸是否已开始并已移动。 Gets if a mouse button down or touch has started and has been moved.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
type |
CameraEventType | 相机事件类型。 The camera event type. |
modifier |
KeyboardEventModifier | 可选 optional 键盘修改器。 The keyboard modifier. |
返回: Returns:
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.
