Skip to content

lightgun-poc / lib/hotkey / watchCombo

Function: watchCombo()

watchCombo(probe, onToggle, tickMs?, onError?): HotkeyWatcher

Defined in: lib/hotkey.ts:331

Polls the probe and fires onToggle once per combo press: on the not-down → all-down edge, and not again until every key was released. A probe that throws mid-run stops the watcher (reported via onError) rather than spamming an error per tick.

Parameters

probe

ComboProbe

onToggle

() => void

tickMs?

number = 25

onError?

(e) => void

Returns

HotkeyWatcher

Released under the MIT License.