Skip to main content

Class: KeyEventManager

A manager for key events. Allows key events to be triggered and intercepted, and also publishes intercepted key events on the event bus.

Methods

interceptKey

interceptKey(key, passThrough): void

Enables interception for a key.

Parameters

NameTypeDescription
keystringThe key to intercept.
passThroughbooleanWhether to pass the event through to the sim after it has been intercepted.

Returns

void

Defined in

src/sdk/data/KeyEventManager.ts:81


triggerKey

triggerKey(key, bypass, value0?, value1?, value2?): Promise<void>

Triggers a key event.

Parameters

NameTypeDefault valueDescription
keystringundefinedThe key to trigger.
bypassbooleanundefinedWhether the event should bypass intercepts.
value0number0The first data value of the key event. Defaults to 0.
value1number0The second data value of the key event. Defaults to 0.
value2number0The third data value of the key event. Defaults to 0.

Returns

Promise<void>

A Promise which is fulfilled after the key event has been triggered.

Defined in

src/sdk/data/KeyEventManager.ts:72


getManager

getManager(bus): Promise<KeyEventManager>

Gets an instance of KeyEventManager. If an instance does not already exist, a new one will be created.

Parameters

NameTypeDescription
busEventBusThe event bus.

Returns

Promise<KeyEventManager>

A Promise which will be fulfilled with an instance of KeyEventManager.

Defined in

src/sdk/data/KeyEventManager.ts:90