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
Name | Type | Description |
---|---|---|
key | string | The key to intercept. |
passThrough | boolean | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
key | string | undefined | The key to trigger. |
bypass | boolean | undefined | Whether the event should bypass intercepts. |
value0 | number | 0 | The first data value of the key event. Defaults to 0 . |
value1 | number | 0 | The second data value of the key event. Defaults to 0 . |
value2 | number | 0 | The 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
Name | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
Returns
Promise
<KeyEventManager
>
A Promise which will be fulfilled with an instance of KeyEventManager.
Defined in
src/sdk/data/KeyEventManager.ts:90