Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
API Reference
Hotkeys API Reference
Hotkey Sequence API Reference
Key hold & held keys API Reference
Hotkey Recorder API Reference
Hotkey Sequence Recorder API Reference
Normalization & format API Reference
Hotkey Sequence API Reference

createHotkeySequences

Function: createHotkeySequences()

ts
function createHotkeySequences(definitions, commonOptions): void;

Defined in: packages/svelte-hotkeys/src/createHotkeySequences.svelte.ts:60

Register multiple global keyboard shortcut sequences for the current component.

Parameters

definitions

MaybeGetter<CreateHotkeySequenceDefinition[]>

commonOptions

MaybeGetter<CreateHotkeySequenceOptions> = {}

Returns

void

Example

svelte
<script lang="ts">
  import { createHotkeySequences } from '@tanstack/svelte-hotkeys'

  createHotkeySequences([
    { sequence: ['G', 'G'], callback: () => scrollToTop() },
    { sequence: ['D', 'D'], callback: () => deleteLine() },
  ])
</script>