function createHotkeySequenceAttachment(
sequence,
callback,
options): Attachment<HTMLElement>;
Defined in: packages/svelte-hotkeys/src/createHotkeySequence.svelte.ts:113
Create an attachment for element-scoped keyboard sequences.
MaybeGetter<HotkeySequence>
HotkeyCallback
MaybeGetter<CreateHotkeySequenceOptions> = {}
Attachment<HTMLElement>
<script lang="ts">
import { createHotkeySequenceAttachment } from '@tanstack/svelte-hotkeys'
const vimKeys = createHotkeySequenceAttachment(['G', 'G'], () => {
scrollToTop()
})
</script>
<div tabindex="0" {@attach vimKeys}>
Focus here and press g then g
</div>