Skip to content
KeyEvent

界面 / 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