function createHotkeyRecorder(options): SvelteHotkeyRecorder<HotkeyChord>;Defined in: packages/svelte-hotkeys/src/createHotkeyRecorder.svelte.ts:102
Svelte function for recording keyboard shortcuts. Options may be a getter.
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.
HotkeyChordRecorderOptions
SvelteHotkeyRecorder<HotkeyChord>
<script lang="ts">
const recorder = createHotkeyRecorder({ onRecord: (hotkey) => (shortcut = hotkey) })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: save })
</script>
<button onclick={recorder.startRecording}>
{recorder.isRecording ? 'Press keys…' : formatForDisplay(shortcut)}
</button>function createHotkeyRecorder(options): SvelteHotkeyRecorder;Defined in: packages/svelte-hotkeys/src/createHotkeyRecorder.svelte.ts:105
Svelte function for recording keyboard shortcuts. Options may be a getter.
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.
HotkeySequenceRecorderOptions
<script lang="ts">
const recorder = createHotkeyRecorder({ onRecord: (hotkey) => (shortcut = hotkey) })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: save })
</script>
<button onclick={recorder.startRecording}>
{recorder.isRecording ? 'Press keys…' : formatForDisplay(shortcut)}
</button>function createHotkeyRecorder(options): SvelteHotkeyRecorder;Defined in: packages/svelte-hotkeys/src/createHotkeyRecorder.svelte.ts:110
Svelte function for recording keyboard shortcuts. Options may be a getter.
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.
() => HotkeySequenceRecorderOptions
<script lang="ts">
const recorder = createHotkeyRecorder({ onRecord: (hotkey) => (shortcut = hotkey) })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: save })
</script>
<button onclick={recorder.startRecording}>
{recorder.isRecording ? 'Press keys…' : formatForDisplay(shortcut)}
</button>function createHotkeyRecorder(options): SvelteHotkeyRecorder<HotkeyChord>;Defined in: packages/svelte-hotkeys/src/createHotkeyRecorder.svelte.ts:113
Svelte function for recording keyboard shortcuts. Options may be a getter.
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.
() => HotkeyChordRecorderOptions
SvelteHotkeyRecorder<HotkeyChord>
<script lang="ts">
const recorder = createHotkeyRecorder({ onRecord: (hotkey) => (shortcut = hotkey) })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: save })
</script>
<button onclick={recorder.startRecording}>
{recorder.isRecording ? 'Press keys…' : formatForDisplay(shortcut)}
</button>function createHotkeyRecorder(options): SvelteHotkeyRecorder;Defined in: packages/svelte-hotkeys/src/createHotkeyRecorder.svelte.ts:116
Svelte function for recording keyboard shortcuts. Options may be a getter.
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.
() => HotkeyRecorderOptions
<script lang="ts">
const recorder = createHotkeyRecorder({ onRecord: (hotkey) => (shortcut = hotkey) })
const sequenceRecorder = createHotkeyRecorder({ maxSteps: Infinity, onRecord: save })
</script>
<button onclick={recorder.startRecording}>
{recorder.isRecording ? 'Press keys…' : formatForDisplay(shortcut)}
</button>