Skip to content

lightgun-poc / lib/buttons / createButtonExecutor

Function: createButtonExecutor() ​

createButtonExecutor(actions, mouse, keyboard): (id, down) => Promise<boolean>

Defined in: lib/buttons.ts:120

Builds the handler that turns (id, down) into device input. Key combos press in declared order (modifiers first) and release in reverse.

Parameters ​

actions ​

Map<string, ButtonAction>

mouse ​

MouseLike

keyboard ​

KeyboardLike

Returns ​

An async executor resolving to false when the id has no action.

(id, down) => Promise<boolean>

Released under the MIT License.