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

ParsedHotkey

Interface: ParsedHotkey

Defined in: hotkey.ts:309

A parsed representation of a hotkey string.

This interface provides a flexible fallback when the Hotkey type doesn't fit your use case. You can pass a ParsedHotkey directly to hotkey functions instead of a hotkey string, allowing for more dynamic or complex scenarios that aren't covered by the type-safe Hotkey union.

Example

ts
// Type-safe hotkey string
useHotkey('Mod+S', handler)

// Fallback: parsed hotkey for dynamic scenarios
const parsed = parseHotkey(userInput)
useHotkey(parsed, handler) // Works even if userInput isn't in Hotkey type

Properties

alt

ts
alt: boolean;

Defined in: hotkey.ts:317

Whether the Alt key is required


ctrl

ts
ctrl: boolean;

Defined in: hotkey.ts:313

Whether the Control key is required


key

ts
key: Key | string & object;

Defined in: hotkey.ts:311

The non-modifier key (e.g., 'S', 'Escape', 'F1', '/', '['). Can be any string for flexibility.


meta

ts
meta: boolean;

Defined in: hotkey.ts:319

Whether the Meta (Command) key is required


modifiers

ts
modifiers: CanonicalModifier[];

Defined in: hotkey.ts:321

List of canonical modifier names that are required, in canonical order


shift

ts
shift: boolean;

Defined in: hotkey.ts:315

Whether the Shift key is required