界面 / KeyEvent
KeyEvent Class
按键事件
Table of contents
Methods
getKey(): string client |
|---|
| 获取按下的键 |
getUserIndex(): number client |
| 获取事件触发玩家index |
isAltDown(): boolean client |
| alt键是否按下 |
isCommandDown(): boolean client |
| command键是否按下 |
isControlDown(): boolean client |
| control键是否按下 |
isShiftDown(): boolean client |
| shift键是否按下 |
toInputEvent(): InputEvent client |
| 转化为 InputEvent* |
默认构造
Methods
getKey
• getKey(): string client
获取按下的键
Returns
string | 返回按下的键的名称 |
|---|
getUserIndex
• getUserIndex(): number client
获取事件触发玩家index
Returns
number | 返回事件触发玩家index |
|---|
isAltDown
• isAltDown(): boolean client
alt键是否按下
Returns
boolean | 返回Alt键是否按下 |
|---|
isCommandDown
• isCommandDown(): boolean client
command键是否按下
Returns
boolean | 返回Command键是否按下 |
|---|
isControlDown
• isControlDown(): boolean client
control键是否按下
Returns
boolean | 返回Control键是否按下 |
|---|
isShiftDown
• isShiftDown(): boolean client
shift键是否按下
Returns
boolean | 返回shift键是否按下 |
|---|
toInputEvent
• toInputEvent(): InputEvent client
转化为 InputEvent*
Returns
InputEvent | 返回转化后 InputEvent |
|---|