Class: KeyEventManager
Defined in: src/sdk/data/KeyEventManager.ts:33
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
Defined in: src/sdk/data/KeyEventManager.ts:81
Enables interception for a key.
Parameters
Parameter | 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
triggerKey()
triggerKey(
key
,bypass
,value0
,value1
,value2
):Promise
<void
>
Defined in: src/sdk/data/KeyEventManager.ts:72
Triggers a key event.
Parameters
Parameter | 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.
getManager()
static
getManager(bus
):Promise
<KeyEventManager
>
Defined in: src/sdk/data/KeyEventManager.ts:90
Gets an instance of KeyEventManager. If an instance does not already exist, a new one will be created.
Parameters
Parameter | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
Returns
Promise
<KeyEventManager
>
A Promise which will be fulfilled with an instance of KeyEventManager.