function createSequenceMatcher(sequence, options): object;
Defined in: sequence.ts:332
Creates a simple sequence matcher for one-off use.
The sequence of hotkeys to match
Options including timeout
"mac" | "windows" | "linux"
number
object
An object with match() and reset() methods
getProgress: () => number;
number
match: (event) => boolean;
KeyboardEvent
boolean
reset: () => void;
void
const matcher = createSequenceMatcher(['G', 'G'], { timeout: 500 })
document.addEventListener('keydown', (event) => {
if (matcher.match(event)) {
console.log('Sequence matched!')
}
})