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
Hotkeys API Reference
App Hotkeys API Reference
Key hold & held keys API Reference
Hotkey Recorder API Reference
Normalization & format API Reference
Hotkey Recorder API Reference

createHotkeyRecorder

Call Signature

ts
function createHotkeyRecorder(options): SolidHotkeyRecorder<HotkeyChord>;
function createHotkeyRecorder(options): SolidHotkeyRecorder<HotkeyChord>;

Defined in: createHotkeyRecorder.ts:45

Solid primitive for recording keyboard shortcuts. Options may be an accessor.

With the default maxSteps: 1, the first valid chord is recorded. With a larger maxSteps, each chord adds a step; the recording commits on Enter (unless commitKeys: 'none'), after idleTimeoutMs, or at maxSteps, and onRecord receives a chord (one step) or a sequence.

Parameters

options

HotkeyChordRecorderOptions

Returns

SolidHotkeyRecorder<HotkeyChord>

Example

tsx
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })

Call Signature

ts
function createHotkeyRecorder(options): SolidHotkeyRecorder;
function createHotkeyRecorder(options): SolidHotkeyRecorder;

Defined in: createHotkeyRecorder.ts:48

Solid primitive for recording keyboard shortcuts. Options may be an accessor.

With the default maxSteps: 1, the first valid chord is recorded. With a larger maxSteps, each chord adds a step; the recording commits on Enter (unless commitKeys: 'none'), after idleTimeoutMs, or at maxSteps, and onRecord receives a chord (one step) or a sequence.

Parameters

options

HotkeySequenceRecorderOptions

Returns

SolidHotkeyRecorder

Example

tsx
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })

Call Signature

ts
function createHotkeyRecorder(options): SolidHotkeyRecorder;
function createHotkeyRecorder(options): SolidHotkeyRecorder;

Defined in: createHotkeyRecorder.ts:53

Solid primitive for recording keyboard shortcuts. Options may be an accessor.

With the default maxSteps: 1, the first valid chord is recorded. With a larger maxSteps, each chord adds a step; the recording commits on Enter (unless commitKeys: 'none'), after idleTimeoutMs, or at maxSteps, and onRecord receives a chord (one step) or a sequence.

Parameters

options

() => HotkeySequenceRecorderOptions

Returns

SolidHotkeyRecorder

Example

tsx
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })

Call Signature

ts
function createHotkeyRecorder(options): SolidHotkeyRecorder<HotkeyChord>;
function createHotkeyRecorder(options): SolidHotkeyRecorder<HotkeyChord>;

Defined in: createHotkeyRecorder.ts:56

Solid primitive for recording keyboard shortcuts. Options may be an accessor.

With the default maxSteps: 1, the first valid chord is recorded. With a larger maxSteps, each chord adds a step; the recording commits on Enter (unless commitKeys: 'none'), after idleTimeoutMs, or at maxSteps, and onRecord receives a chord (one step) or a sequence.

Parameters

options

() => HotkeyChordRecorderOptions

Returns

SolidHotkeyRecorder<HotkeyChord>

Example

tsx
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })

Call Signature

ts
function createHotkeyRecorder(options): SolidHotkeyRecorder;
function createHotkeyRecorder(options): SolidHotkeyRecorder;

Defined in: createHotkeyRecorder.ts:59

Solid primitive for recording keyboard shortcuts. Options may be an accessor.

With the default maxSteps: 1, the first valid chord is recorded. With a larger maxSteps, each chord adds a step; the recording commits on Enter (unless commitKeys: 'none'), after idleTimeoutMs, or at maxSteps, and onRecord receives a chord (one step) or a sequence.

Parameters

options

() => HotkeyRecorderOptions

Returns

SolidHotkeyRecorder

Example

tsx
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })
const recorder = createHotkeyRecorder({ onRecord: setShortcut })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: setShortcut })