function createHotkeyAttachment<T>(
hotkey,
callback,
options?): Attachment<HTMLElement>;Defined in: packages/svelte-hotkeys/src/createHotkey.svelte.ts:94
Create an attachment for an element-scoped hotkey: a chord, a sequence, or an app hotkey that listens on the attached element.
T extends AppHotkey<string, HotkeyChord | HotkeySequence | null>
MaybeGetter<T>
HotkeyCallback
MaybeGetter<CreateAppHotkeyOptions<T>>
Attachment<HTMLElement>
<script lang="ts">
const saveKey = createHotkeyAttachment('Mod+S', () => save())
</script>
<div tabindex="0" {@attach saveKey}>Editor content</div>function createHotkeyAttachment<T>(
hotkey,
callback,
options?): Attachment<HTMLElement>;Defined in: packages/svelte-hotkeys/src/createHotkey.svelte.ts:99
Create an attachment for an element-scoped hotkey: a chord, a sequence, or an app hotkey that listens on the attached element.
T extends RegisterableHotkey
MaybeGetter<T>
HotkeyCallback<HotkeyCallbackContextFor<T>>
MaybeGetter<AdapterOptionsFor<T, CreateHotkeyTarget>>
Attachment<HTMLElement>
<script lang="ts">
const saveKey = createHotkeyAttachment('Mod+S', () => save())
</script>
<div tabindex="0" {@attach saveKey}>Editor content</div>