TanStack
Hotkeys API Reference

getHotkeyRegistrations

ts
function getHotkeyRegistrations(): SvelteHotkeyRegistrations;

Defined in: packages/svelte-hotkeys/src/getHotkeyRegistrations.svelte.ts:39

Svelte function that returns reactive access to every hotkey registration, chords and sequences, from the singleton HotkeyManager.

This function does NOT require the HotkeysProvider.

Returns

SvelteHotkeyRegistrations

Example

svelte
<script lang="ts">
  const registrations = getHotkeyRegistrations()
</script>

{#each registrations.hotkeys as reg (reg.id)}
  <li>{reg.options.meta?.name}: {formatForDisplay(reg.hotkey)}</li>
{/each}