处理用户输入事件. 自定义函数可以添加到
当用户输入输入时.
| Name | Type | Default | Description |
|---|---|---|---|
element |
HTMLCanvasElement |
文档
|
optional 添加事件的内容 . |
Members
鼠标事件将在之后禁用时间, 以毫秒计
接收任何触摸事件,从而忽略任何模拟鼠标事件.
-
Default Value:
800
The amount of time, in milliseconds, before a touch on the screen becomes a
抚摸和抱住.
-
Default Value:
1500
Methods
删除此对象所持有的听众.
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:
getInputAction(type, modifier) → ScreenSpaceEventHandler.PositionedEventCallback|ScreenSpaceEventHandler.MotionEventCallback|ScreenSpaceEventHandler.WheelEventCallback|ScreenSpaceEventHandler.TwoPointEventCallback|ScreenSpaceEventHandler.TwoPointMotionEventCallback
返回输入事件时要执行的函数.
| Name | Type | Description |
|---|---|---|
type |
ScreenSpaceEventType | 输入事件的 ScreenSpaceEventType . |
modifier |
KeyboardEventModifier |
optional
A KeyboardEventModifier key that is held when a type
event occurs. |
Returns:
在输入事件上要执行的函数 .
如果此对象被销毁, 返回真实; 否则, 错误 .
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.
删除输入事件上要执行的函数.
| Name | Type | Description |
|---|---|---|
type |
ScreenSpaceEventType | 输入事件的 ScreenSpaceEventType . |
modifier |
KeyboardEventModifier |
optional
A KeyboardEventModifier key that is held when a type
event occurs. |
设置要执行的函数 .
| Name | Type | Description |
|---|---|---|
action |
ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback | 当输入事件发生时要执行的函数 . |
type |
ScreenSpaceEventType | 输入事件的 ScreenSpaceEventType . |
modifier |
KeyboardEventModifier |
optional
A KeyboardEventModifier key that is held when a type
event occurs. |
Type Definitions
一个事件从一个位置开始,从另一个位置结束.
Properties:
| Name | Type | Description |
|---|---|---|
startPosition |
Cartesian2 | |
endPosition |
Cartesian2 |
| Name | Type | Description |
|---|---|---|
event |
ScreenSpaceEventHandler.MotionEvent | 引发听众的事件 |
发生在屏幕上一个位置的事件.
Properties:
| Name | Type | Description |
|---|---|---|
position |
Cartesian2 |
| Name | Type | Description |
|---|---|---|
event |
ScreenSpaceEventHandler.PositionedEvent | 引发听众的事件 |
发生在屏幕上两个位置的事件.
Properties:
| Name | Type | Description |
|---|---|---|
position1 |
Cartesian2 | |
position2 |
Cartesian2 |
| Name | Type | Description |
|---|---|---|
event |
ScreenSpaceEventHandler.TwoPointEvent | 引发听众的事件 |
活动从屏幕上的两个位置开始,转移到另外两个位置.
Properties:
| Name | Type | Description |
|---|---|---|
position1 |
Cartesian2 | |
position2 |
Cartesian2 | |
previousPosition1 |
Cartesian2 | |
previousPosition2 |
Cartesian2 |
| Name | Type | Description |
|---|---|---|
event |
ScreenSpaceEventHandler.TwoPointMotionEvent | 引发听众的事件 |
| Name | Type | Description |
|---|---|---|
delta |
number | 鼠标轮子移动的量 |