Defined in: hotkey-recorder.ts:207
Options for recording up to maxSteps chords. A one-step recording commits as a chord string; two or more steps commit as a sequence.
optional cancelOnBlur?: boolean;Defined in: hotkey-recorder.ts:163
Whether to cancel recording when the window loses focus, as when the user switches apps or tabs, opens browser devtools, or clicks into an iframe. Keys pressed elsewhere never reach the page. Focus moving to another element on the page doesn't cancel. Default: true
HotkeyRecorderBaseOptions.cancelOnBluroptional commitKeys?: HotkeyRecorderCommitKeys;Defined in: hotkey-recorder.ts:221
Whether plain Enter commits the recorded steps. Default: 'enter'
optional detectConflicts?: boolean | HotkeyConflictOptions;Defined in: hotkey-recorder.ts:84
Opt in to live-registry conflicts, including sequence prefixes. Default: false.
HotkeyRecorderBaseOptions.detectConflictsoptional idleTimeoutMs?: number;Defined in: hotkey-recorder.ts:223
Commit automatically after this many milliseconds without a new step. Disabled when unset or 0.
optional ignoreInputs?: boolean;Defined in: hotkey-recorder.ts:174
Whether to ignore keyboard events from input-like elements (text inputs, textarea, select, contenteditable) while recording. When true, typing in inputs passes through normally (Escape still cancels). Defaults to true.
HotkeyRecorderBaseOptions.ignoreInputsmaxSteps: number;Defined in: hotkey-recorder.ts:209
Maximum number of chords to record. Reaching it commits automatically. Use Infinity for no limit.
optional onCancel?: () => void;Defined in: hotkey-recorder.ts:156
Optional callback when recording is cancelled: Escape, Tab without recordTab, or the window losing focus with cancelOnBlur
void
HotkeyRecorderBaseOptions.onCanceloptional onClear?: () => void;Defined in: hotkey-recorder.ts:168
Optional callback when the recording is cleared: Backspace/Delete with no modifiers and no recorded steps
void
HotkeyRecorderBaseOptions.onClearonRecord: (hotkey, context) => void;Defined in: hotkey-recorder.ts:219
Callback when a hotkey is successfully recorded. context is the one validate received, with the key press that recorded each step.
HotkeyRecorderValidationContext
void
optional onReject?: (rejection) => void;Defined in: hotkey-recorder.ts:86
Rejected candidates leave recording active.
void
HotkeyRecorderBaseOptions.onRejectoptional platform?: HotkeyPlatform;Defined in: hotkey-recorder.ts:82
Platform used for Mod and AltGraph handling. Defaults to platform detection.
HotkeyRecorderBaseOptions.platformoptional recordBy?: RecorderKeyMode;Defined in: hotkey-recorder.ts:80
How the pressed key is written. Default: 'auto'.
HotkeyRecorderBaseOptions.recordByoptional recordTab?: boolean;Defined in: hotkey-recorder.ts:181
Whether to record Tab and Shift+Tab. By default they cancel recording and move focus, so keyboard users can leave the recorder. Tab with Control, Alt, or Meta isn't affected. When true, tell users that Escape cancels. Default: false
HotkeyRecorderBaseOptions.recordTaboptional validate?: (hotkey, context) => string | boolean;Defined in: hotkey-recorder.ts:211
Return true to accept, or false or a message to reject while staying in recording mode. The message is passed to onReject.
HotkeyRecorderValidationContext
string | boolean