HotkeyRegistry
Defined in: src/core/hotkeys.ts:159
Process-wide registry of named, grouped, context-scoped hotkeys. Use getInstance or the useHotkey React hook.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HotkeyRegistry():
HotkeyRegistry
Returns
Section titled “Returns”HotkeyRegistry
Accessors
Section titled “Accessors”context
Section titled “context”Get Signature
Section titled “Get Signature”get context():
string|null
Defined in: src/core/hotkeys.ts:183
The active app context, or null when none is set.
Returns
Section titled “Returns”string | null
version
Section titled “version”Get Signature
Section titled “Get Signature”get version():
number
Defined in: src/core/hotkeys.ts:178
Monotonic change counter — a stable snapshot for useSyncExternalStore.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”dispatch()
Section titled “dispatch()”dispatch(
ev,phase):boolean
Defined in: src/core/hotkeys.ts:278
Dispatch a key event against the active hotkeys. phase selects which
bindings are eligible: "priority" (called before the focused widget)
fires only modified/function keys; "fallback" (after the focus chain
declined) fires the rest. Returns true and marks the event handled when a
hotkey ran. The most recently registered match wins.
Parameters
Section titled “Parameters”"priority" | "fallback"
Returns
Section titled “Returns”boolean
groups()
Section titled “groups()”groups(
opts?):HotkeyGroup[]
Defined in: src/core/hotkeys.ts:261
list, sectioned by group (groups in first-appearance order).
Parameters
Section titled “Parameters”ListOptions = {}
Returns
Section titled “Returns”list()
Section titled “list()”list(
opts?):Hotkey[]
Defined in: src/core/hotkeys.ts:250
Hotkeys matching the options, in registration order.
Parameters
Section titled “Parameters”ListOptions = {}
Returns
Section titled “Returns”Hotkey[]
popContext()
Section titled “popContext()”popContext():
void
Defined in: src/core/hotkeys.ts:200
Leave the innermost context entered with pushContext.
Returns
Section titled “Returns”void
pushContext()
Section titled “pushContext()”pushContext(
context):void
Defined in: src/core/hotkeys.ts:194
Enter a nested context (e.g. a modal flow); pair with popContext.
Parameters
Section titled “Parameters”context
Section titled “context”string
Returns
Section titled “Returns”void
register()
Section titled “register()”register(
opts): () =>void
Defined in: src/core/hotkeys.ts:220
Register a hotkey; returns a disposer. Later registrations on the same key win at dispatch time (and shadow rather than replace — disposing the newer one restores the older).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”() => void
setContext()
Section titled “setContext()”setContext(
context):void
Defined in: src/core/hotkeys.ts:188
Replace the whole context stack with one context (or none).
Parameters
Section titled “Parameters”context
Section titled “context”string | null
Returns
Section titled “Returns”void
subscribe()
Section titled “subscribe()”subscribe(
cb): () =>void
Defined in: src/core/hotkeys.ts:208
Subscribe to registry changes; returns an unsubscribe function.
Parameters
Section titled “Parameters”() => void
Returns
Section titled “Returns”() => void
getInstance()
Section titled “getInstance()”
staticgetInstance():HotkeyRegistry
Defined in: src/core/hotkeys.ts:162
The shared singleton.
Returns
Section titled “Returns”HotkeyRegistry
reset()
Section titled “reset()”
staticreset():void
Defined in: src/core/hotkeys.ts:167
Drop all registrations and contexts (test isolation).
Returns
Section titled “Returns”void