Skip to main content

Interface: M2KeyboardEvent

Describes an event on the device's built-in keyboard.

Remarks​

The built-in keyboard is defined as the hardware keyboard on a desktop/laptop or the built-in soft keyboard on a tablet or phone. The latter is not used in m2c2kit. On tablet or phone, the VirtualKeyboard in the @m2c2kit/addons package should be used for key events.

Extends​

Properties​

altKey​

altKey: boolean

True if the Alt key is pressed.

Defined in​

m2c2kit/packages/core/src/M2KeyboardEvent.ts:22


code​

code: string

Code for the key, not taking into account any modifiers.

Defined in​

m2c2kit/packages/core/src/M2KeyboardEvent.ts:16


ctrlKey​

ctrlKey: boolean

True if the Control key is pressed.

Defined in​

m2c2kit/packages/core/src/M2KeyboardEvent.ts:20


handled?​

optional handled: boolean

Has the event been taken care of by the listener and not be dispatched to other targets?

Inherited from​

M2NodeEvent.handled

Defined in​

m2c2kit/packages/core/src/M2Event.ts:26


iso8601Timestamp​

iso8601Timestamp: string

Timestamp of th event, from new Date().toISOString()

Inherited from​

M2NodeEvent.iso8601Timestamp

Defined in​

m2c2kit/packages/core/src/M2Event.ts:30


key​

key: string

String that is generated when key is pressed, with any modifiers (e.g., Shift) applied.

Defined in​

m2c2kit/packages/core/src/M2KeyboardEvent.ts:14


metaKey​

metaKey: boolean

True if the Meta key is pressed.

Defined in​

m2c2kit/packages/core/src/M2KeyboardEvent.ts:24


repeat​

repeat: boolean

True if the event is being repeated.

Defined in​

m2c2kit/packages/core/src/M2KeyboardEvent.ts:26


sequence?​

optional sequence: number

Sequence number of event.

Remarks​

Sequence number is guaranteed to reflect order of events, but not necessarily contiguous, e.g., could be 1, 2, 5, 10, 11, 24.

Inherited from​

M2NodeEvent.sequence

Defined in​

m2c2kit/packages/core/src/M2Event.ts:35


shiftKey​

shiftKey: boolean

True if the Shift key is pressed.

Defined in​

m2c2kit/packages/core/src/M2KeyboardEvent.ts:18


target​

target: string | M2Node

The M2Node on which the event occurred. If the event has gone through serialization, the string will be the node's UUID.

Inherited from​

M2NodeEvent.target

Defined in​

m2c2kit/packages/core/src/M2NodeEvent.ts:7


timestamp​

timestamp: number

Timestamp of the event, from performance.now()

Inherited from​

M2NodeEvent.timestamp

Defined in​

m2c2kit/packages/core/src/M2Event.ts:28


type​

type: string

Type of event.

Inherited from​

M2NodeEvent.type

Defined in​

m2c2kit/packages/core/src/M2Event.ts:22