Skip to main content

KKeyBoardEvent

kds-plugin-document / Exports / KKeyBoardEvent

Interface: KKeyBoardEvent

酷大师键盘事件

The KKeyBoardEvent class describes a user interaction with the keyboard. It is similar to the KeyBoardEvent class in Web APIs.

Table of contents​

Methods​

Methods​

altKey​

▸ altKey(): boolean

判断是否是 alt 键

Get a Boolean that indicates if the alt key was pressed (true) or not (false) when the event occurred.

Returns​

boolean

True if the alt key was pressed, else false.

Defined in​

api.d.ts:3963


ctrlKey​

▸ ctrlKey(): boolean

判断是否是 ctrl 键

Get a Boolean that indicates if the control key was pressed (true) or not (false) when the event occurred.

Returns​

boolean

True if the control key was pressed, else false.

Defined in​

api.d.ts:3954


getCode​

▸ getCode(): string

获取按键的编码

Get a physical key on the keyboard.

Returns​

string

Defined in​

api.d.ts:3945


getKey​

▸ getKey(): string

获取按键的名称

Get the value of the key pressed by the user.

Returns​

string

Defined in​

api.d.ts:3936


isComposing​

▸ isComposing(): boolean

判断是否是复合按键

Get a Boolean value indicating if the event is fired within a composition session.

Returns​

boolean

True if within a composition session, else false.

Defined in​

api.d.ts:3972


shiftKey​

▸ shiftKey(): boolean

判断是否是 shift 键

Get a Boolean that indicates if the shift key was pressed (true) or not (false) when the event occurred.

Returns​

boolean

True if the shift key was pressed, else false.

Defined in​

api.d.ts:3981