Skip to content
KeyEvent

UI / KeyEvent

KeyEvent Class ​

Key events

Table of contents ​

Methods ​

getKey(): string other
Get press keys
getUserIndex(): number other
Get event trigger Player index
isAltDown(): boolean other
Is the alt key pressed
isCommandDown(): boolean other
Whether the command key is press
isControlDown(): boolean other
Is the control key pressed
isShiftDown(): boolean other
Is the shift key pressed
toInputEvent(): InputEvent other
Convert to InputEvent*

Default Construction

Methods ​

getKey ​

• getKey(): string other

Get press keys

Returns ​

stringReturns the name of the press key

getUserIndex ​

• getUserIndex(): number other

Get event trigger Player index

Returns ​

numberReturn event triggers player index

isAltDown ​

• isAltDown(): boolean other

Is the alt key pressed

Returns ​

booleanReturn to whether the Alt key is press

isCommandDown ​

• isCommandDown(): boolean other

Whether the command key is press

Returns ​

booleanReturn whether the Command key is pressed or not

isControlDown ​

• isControlDown(): boolean other

Is the control key pressed

Returns ​

booleanIs the Control key pressed to return

isShiftDown ​

• isShiftDown(): boolean other

Is the shift key pressed

Returns ​

booleanReturn whether the shift key is press

toInputEvent ​

• toInputEvent(): InputEvent other

Convert to InputEvent*

Returns ​

InputEventReturn InputEvent after conversion