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
Hotkeys API Reference

useHotkeyRegistrations

Function: useHotkeyRegistrations()

ts
function useHotkeyRegistrations(): HotkeyRegistrationsResult;

Defined in: useHotkeyRegistrations.ts:54

React hook that reactively reads all hotkey and sequence registrations from the singleton managers.

This is a standalone hook that does NOT require the HotkeysProvider. It subscribes to both HotkeyManager and SequenceManager stores and re-renders when registrations change.

Returns

HotkeyRegistrationsResult

Object with hotkeys and sequences arrays

Example

tsx
function ShortcutPalette() {
  const { hotkeys, sequences } = useHotkeyRegistrations()

  return (
    <ul>
      {hotkeys.map((reg) => (
        <li key={reg.id}>
          {reg.options.meta?.name ?? reg.hotkey}
        </li>
      ))}
      {sequences.map((reg) => (
        <li key={reg.id}>
          {reg.options.meta?.name ?? reg.sequence.join(' ')}
        </li>
      ))}
    </ul>
  )
}