-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Project
ide
Description
WhichKeyProvider installs a capture-phase window keydown listener (WhichKeyContext.tsx). When a chord prefix is already pending, the next key appends to the sequence:
const newPrefix = [...currentSequence.keystrokes, keystroke];
There is no if (event.repeat) return (or equivalent). Holding a key so the OS/browser emits auto-repeat keydown events appends duplicate Keystroke entries to newPrefix. That usually fails findContinuations(newPrefix) and hits the branch that calls cancelSequence() — the user loses the in-progress chord even though they only held a modifier or key as part of a multi-step binding.
This is independent of IME (inputs are skipped) and independent of SELECT interception (already reported on bounty: WhichKey runs when focus is on <select> because only INPUT / TEXTAREA / contentEditable are excluded).
Error Message
Debug Logs
System Information
Cortex IDE alpha
Windows / macOS / Linux (any OS that emits key repeat)Screenshots
Steps to Reproduce
- Ensure Which Key is enabled (settings).
- Start a key chord that the app treats as a prefix (so
showForPrefixruns and a sequence is pending). - Hold the key that produced the first
Keystrokeso repeat events fire before completing the chord. - Observe that the sequence may cancel (
cancelSequence) instead of staying open for the next deliberate key.
Expected Behavior
Auto-repeat keydowns should not advance or corrupt chord state (typically ignore event.repeat while a Which Key sequence is active, or treat repeat as a no-op for chord extension).
Actual Behavior
Repeat events append to newPrefix and can invalidate the sequence.
Additional Context
No response
