Skip to content

fix(desktop-gpui): record ⌘⇧ shortcuts with digits and symbols - #3635

Open
HlaKarki wants to merge 1 commit into
CapSoftware:mainfrom
HlaKarki:fix/shortcut-shifted-symbols
Open

HlaKarki wants to merge 1 commit into
CapSoftware:mainfrom
HlaKarki:fix/shortcut-shifted-symbols

Conversation

@HlaKarki

@HlaKarki HlaKarki commented Nov 2, 2026 •

Copy link
Copy Markdown

Fixes #3634

On macOS, gpui turns ⌘⇧4 into cmd-$ with Shift cleared, so the shortcut recorder rejected every ⌘⇧ combo on a digit or symbol key.

unfold_shifted_symbol maps the 21 US shifted symbols back to their key and restores Shift. It only does that while the recorder's held modifiers say Shift is down. Those come from window.modifiers() and on_modifiers_changed. AZERTY has an unshifted $ key, and without that check it would record as ⌘⇧4.

The mapping assumes a US layout, like the existing punctuation table in hotkey_code_for_key. Recording the physical key would need gpui's Keystroke to carry the key code, which is a bigger change in the fork.

Testing

  • cargo test --bin cap-gpui on macOS 27.0: 1565 passed, 0 failed, 32 ignored.
  • The new shifted_symbols_record_as_their_key_with_shift test covers all 21 symbols, the AZERTY $ case and letters.
  • Dev build on macOS 27.0: ⌘⇧4 records as ⌘⇧4 and takes an area screenshot.
Cap shortcut recorder showing ⌘⇧4 recorded for Screenshot an area

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Restores Shift and the US base key when GPUI reports a shifted symbol with Shift cleared.

  • The shortcut recorder saves shifted symbols as their base keys with Shift.

HlaKarki explicitly treats US-layout mapping as intentional and defers physical-key support to a broader GPUI change.

Reviews (1) · Last reviewed commit: "fix: shortcut recorder; record Shift sho..." · Reviewed by Greptile

@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Nov 2, 2026 12:17am UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 2, 2026 00:17 Inactive
@HlaKarki
HlaKarki marked this pull request as ready for review November 2, 2026 00:18

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 8d1a487c Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shortcut recorder rejects ⌘⇧ with a digit or symbol (e.g. ⌘⇧4)

1 participant