聚合输入事件。例如,假设在帧之间接收到以下输入:
鼠标左键向下,鼠标移动,鼠标移动,鼠标左键向上。这些事件将聚合为
一个具有鼠标开始和结束位置的事件。
Name | Type | Default | Description |
---|---|---|---|
canvas |
HTMLCanvasElement |
document
|
optional 要为其处理事件的元素。 |
Members
获取是否有任何鼠标按钮已按下、触摸已开始或滚轮是否已移动。
currentMousePosition : Cartesian2
获取当前鼠标位置。
Methods
Throws:
-
DeveloperError :此对象已销毁,即调用destroy()。
Example:
handler = handler && handler.destroy();
See:
获取按钮被按下或触摸开始的时间。
Name | Type | Description |
---|---|---|
type |
CameraEventType | 摄影机事件类型。 |
modifier |
KeyboardEventModifier | optional 键盘修改器。 |
Returns:
按下按钮或触摸开始的时间。
获取按钮释放或触摸结束的时间。
Name | Type | Description |
---|---|---|
type |
CameraEventType | 摄影机事件类型。 |
modifier |
KeyboardEventModifier | optional 键盘修改器。 |
Returns:
按钮被释放或触摸结束的时间。
获取最后一个移动事件(不是聚合事件)的开始位置和结束位置。
Name | Type | Description |
---|---|---|
type |
CameraEventType | 摄影机事件类型。 |
modifier |
KeyboardEventModifier | optional 键盘修改器。 |
Returns:
获取当前事件的聚合开始位置和结束位置。
Name | Type | Description |
---|---|---|
type |
CameraEventType | 摄影机事件类型。 |
modifier |
KeyboardEventModifier | optional 键盘修改器。 |
Returns:
getStartMousePosition(type, modifier) → Cartesian2
获取启动聚合的鼠标位置。
Name | Type | Description |
---|---|---|
type |
CameraEventType | 摄影机事件类型。 |
modifier |
KeyboardEventModifier | optional 键盘修改器。 |
Returns:
鼠标位置。
获取鼠标按钮是否按下或触摸已开始。
Name | Type | Description |
---|---|---|
type |
CameraEventType | 摄影机事件类型。 |
modifier |
KeyboardEventModifier | optional 键盘修改器。 |
Returns:
无论鼠标按钮是否按下或触摸已开始。
Returns:
如果此对象被销毁,则为
true
;否则为false
。获取鼠标按钮按下或触摸是否已开始并已移动。
Name | Type | Description |
---|---|---|
type |
CameraEventType | 摄影机事件类型。 |
modifier |
KeyboardEventModifier | optional 键盘修改器。 |
Returns:
如果鼠标按下或触摸已开始并已移动,则返回
true
;否则,返回false
表示已处理所有事件,并应重置聚合器以处理新事件。