Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, well-tested keyboard-shortcut recording fix that normalizes shifted digits and brackets without changing schemas, defaults, or unrelated runtime paths. The implementation also preserves logical keypad navigation when NumLock is off. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84529ecf99
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const digitMatch = code?.match(/^(?:Digit|Numpad)(\d)$/); | ||
| if (digitMatch?.[1]) { | ||
| return digitMatch[1]; |
There was a problem hiding this comment.
Preserve navigation keys when Num Lock is off
When Num Lock is disabled, browsers report keypad keys with logical values such as End or PageDown while their physical codes remain Numpad1 or Numpad3. This unconditional rewrite therefore records Ctrl+keypad-1 as mod+1 instead of mod+end; combined with the new runtime numpad aliases, the same keystroke can execute the global thread.jump.1 binding rather than its navigation action. Gate numpad normalization on the logical key or Num Lock state instead of matching the physical code alone.
Useful? React with 👍 / 👎.
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Dismissing prior approval to re-evaluate 4e668b5
Dismissing prior approval to re-evaluate 867c724
867c724 to
f58bf2e
Compare
Dismissing prior approval to re-evaluate f58bf2e
|
Closing this PR as this behavior was addressed upstream in PR #8103 (commit Upstream resolved this via:
Thank you! |
When recording a shortcut in Settings > Keyboard Shortcuts that includes Shift (e.g.
Mod+Shift+1orShift+6),keybindingFromKeyboardEventpreviously evaluatedevent.keydirectly. On standard keyboard layouts with Shift held down, this produced the shifted symbol (such as!or^) instead of the digit number, saving non-canonical bindings likeshift+^ormod+shift+!.While legacy
shift+^bindings continued to match at runtime becauseresolveEventKeysmatchesevent.key, storing shifted symbols produces non-canonical, ugly shortcut strings that diverge from standard keybinding conventions.Changes
apps/web/src/keybindings.ts): ExportedcanonicalKeyFromEventCode, which derives canonical key tokens directly from the existingEVENT_CODE_KEY_ALIASESmapping (Digit0..Digit9->0..9,BracketLeft->[,BracketRight->]). This keeps a single source of truth for physical key aliasing between runtime dispatch and settings capture.KeybindingsSettings.logic.ts):normalizeShortcutKeyTokennow reusescanonicalKeyFromEventCode(event.code)before falling back to normalized layout keys. Numpad keys are not in the alias map, so NumLock-off keypad navigation (e.g.End) preserves navigation behavior and is never hijacked as a digit.keybindings.test.ts):canonicalKeyFromEventCodemapping across digits, brackets, and non-aliased keys.key: !,code: Digit1) resolve to canonical digit commands (modelPicker.jump.1).key: ^,code: Digit6) resolve toshift+6bindings.shift+^) remain backwards-compatible and continue to fire viaevent.key.key: End,code: Numpad1) does not trigger digit shortcuts.Visual Comparison
Validation
Ran test suite:
vp test apps/web/src/components/settings/KeybindingsSettings.logic.test.ts apps/web/src/keybindings.test.ts(all 65 tests pass).vp check --fix(formatting compliant).Note
Fix keybinding digit shortcuts to capture numbers via
event.codeinstead of shifted symbolscanonicalKeyFromEventCodein keybindings.ts to map physical keyboard event codes (digits, brackets, numpad) to canonical key tokensnormalizeShortcutKeyTokenandkeybindingFromKeyboardEventin KeybindingsSettings.logic.ts to prefer the physical code overevent.key, so shifted digits like!or@are stored as1and2event.keynormalization; modifier ordering and platform handling are unchanged!) remain resolvable, but newly captured digit shortcuts will now record numeric tokens insteadMacroscope summarized f58bf2e.