# createSequenceMatcher

<!-- DO NOT EDIT: this page is autogenerated from the type comments -->

```ts
function createSequenceMatcher(sequence, options?): object;
```

Defined in: [match.ts:248](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/match.ts#L248)

Creates a simple sequence matcher for one-off use.

This is a low-level helper that does not support ignoreInputs, target,
or other HotkeyOptions. Callers must handle input filtering themselves
if attaching to document.

Modifier presses, auto-repeats, and keys an input method editor reads are
not steps. Lock keys such as CapsLock and NumLock, Fn, and dead keys advance
the sequence when they match the next step and otherwise keep its progress.

## Parameters

### sequence

[`RegisterableHotkeySequence`](../type-aliases/RegisterableHotkeySequence.md)

The sequence of hotkeys to match

### options?

Options including timeout

#### platform?

[`HotkeyPlatform`](../type-aliases/HotkeyPlatform.md)

#### timeout?

`number`

## Returns

`object`

An object with match() and reset() methods

### getProgress

```ts
getProgress: () => number;
```

#### Returns

`number`

### match

```ts
match: (event) => boolean;
```

#### Parameters

##### event

`KeyboardEvent`

#### Returns

`boolean`

### reset

```ts
reset: () => void;
```

#### Returns

`void`

## Example

```ts
const matcher = createSequenceMatcher(['G', 'G'], { timeout: 500 })

document.addEventListener('keydown', (event) => {
  if (matcher.match(event)) {
    console.log('Sequence matched!')
  }
})
```
