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 API Reference
Held Keys API Reference
Hotkey Recorder API Reference
Hotkey Sequence Recorder API Reference
Format for Display API Reference
Hotkeys API Reference

HotkeyRegistrationHandle

Interface: HotkeyRegistrationHandle

Defined in: hotkey-manager.ts:97

A handle returned from HotkeyManager.register() that allows updating the callback and options without re-registering the hotkey.

Example

ts
const handle = manager.register('Mod+S', callback, options)

// Update callback without re-registering (avoids stale closures)
handle.callback = newCallback

// Update options without re-registering
handle.setOptions({ enabled: false })

// Check if still active
if (handle.isActive) {
  // ...
}

// Unregister when done
handle.unregister()

Properties

callback

ts
callback: HotkeyCallback;

Defined in: hotkey-manager.ts:102

The callback function. Can be set directly to update without re-registering. This avoids stale closures when the callback references React state.


id

ts
readonly id: string;

Defined in: hotkey-manager.ts:104

Unique identifier for this registration


isActive

ts
readonly isActive: boolean;

Defined in: hotkey-manager.ts:106

Check if this registration is still active (not unregistered)


setOptions()

ts
setOptions: (options) => void;

Defined in: hotkey-manager.ts:111

Update options (merged with existing options). Useful for updating enabled, preventDefault, etc. without re-registering.

Parameters

options

Partial<HotkeyOptions>

Returns

void


unregister()

ts
unregister: () => void;

Defined in: hotkey-manager.ts:113

Unregister this hotkey

Returns

void