Skip to content

Commit 31943fc

Browse files
ryan-williamsclaude
andcommitted
Default sequenceTimeout to Infinity (no timeout)
Sequences no longer auto-submit by default. Users can still set a finite timeout if desired. Updated doc comments to reflect new default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e1570b8 commit 31943fc

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Wrap your app to enable the hotkeys system:
107107
storageKey: 'use-kbd', // localStorage key for user overrides (default)
108108
modalTrigger: '?', // Open shortcuts modal (default; false to disable)
109109
omnibarTrigger: 'meta+k', // Open omnibar (default; false to disable)
110-
sequenceTimeout: 1000, // ms before sequence times out (default)
110+
sequenceTimeout: Infinity, // ms before sequence times out (default: no timeout)
111111
}}>
112112
{children}
113113
</HotkeysProvider>

src/HotkeysProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface HotkeysConfig {
1313
/** Storage key for persisting user binding overrides */
1414
storageKey?: string
1515

16-
/** Timeout in ms before a sequence auto-submits (default: DEFAULT_SEQUENCE_TIMEOUT) */
16+
/** Timeout in ms before a sequence auto-submits (default: Infinity, no timeout) */
1717
sequenceTimeout?: number
1818

1919
/** When true, keys with conflicts are disabled (default: true) */

src/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* Default timeout in milliseconds before a key sequence auto-submits.
3-
* Used when no explicit `sequenceTimeout` is provided.
2+
* Default timeout for key sequences (no timeout).
3+
* Set to a finite number (ms) to auto-submit sequences after that duration.
44
*/
5-
export const DEFAULT_SEQUENCE_TIMEOUT = 1000
5+
export const DEFAULT_SEQUENCE_TIMEOUT = Infinity
66

77
/**
88
* Reserved action IDs for built-in UI components.

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ export interface RecordHotkeyOptions {
7474
onShiftTab?: () => void
7575
/** Prevent default on captured keys (default: true) */
7676
preventDefault?: boolean
77-
/** Timeout in ms before sequence is submitted (default: DEFAULT_SEQUENCE_TIMEOUT).
77+
/** Timeout in ms before sequence is submitted (default: Infinity, no timeout).
7878
* Set to 0 for immediate submit (no sequences - first key press is captured).
79-
* Set to Infinity for no auto-submit (user must explicitly commit via Enter/Tab). */
79+
* Set to a finite number for auto-submit after that duration. */
8080
sequenceTimeout?: number
8181
/** When true, pause the auto-submit timeout (useful for conflict warnings). Default: false */
8282
pauseTimeout?: boolean

src/useHotkeys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface UseHotkeysOptions {
2929
stopPropagation?: boolean
3030
/** Enable hotkeys even when focused on input/textarea/select (default: false) */
3131
enableOnFormTags?: boolean
32-
/** Timeout in ms for sequences (default: DEFAULT_SEQUENCE_TIMEOUT) */
32+
/** Timeout in ms for sequences (default: Infinity, no timeout) */
3333
sequenceTimeout?: number
3434
/** What happens on timeout: 'submit' executes current sequence, 'cancel' resets (default: 'submit') */
3535
onTimeout?: 'submit' | 'cancel'

0 commit comments

Comments
 (0)