Skip to content

fix(project): show the macOS Option and right Command keys in key overlays - #2657

Merged
richiemcilroy merged 2 commits into
CapSoftware:mainfrom
Zingzy:fix/keyboard-macos-option
Oct 26, 2026
Merged

richiemcilroy merged 2 commits into
CapSoftware:mainfrom
Zingzy:fix/keyboard-macos-option

Conversation

@Zingzy

@Zingzy Zingzy commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

On macOS, keyboard overlays drop the Option key and show its raw name instead. Pressing ⌥⌘← shows ⌘LOPTION and then ⌘←. Right Command is never treated as a modifier, so shortcuts typed with it lose their ⌘.

Cause

device_query names the macOS Option keys LOption/ROption and right Command RCommand (device_state/macos/mod.rs in 4.0.1). keycode_to_string in crates/recording/src/cursor.rs has no arm for them, so the fallback writes those names to the key log as they are. crates/project/src/keyboard.rs only counts LAlt/RAlt/LMeta/RMeta/Meta/Command as modifiers. The Option press then goes through the combo branch as an ordinary key and prints as ⌘ plus LOPTION, and it is missing from the modifier prefix of the next key.

Fix

  • MODIFIER_KEYS, modifier_prefix and the command check in group_key_events now include LOption, ROption and RCommand.
  • The fix is on the reading side, so existing recordings need no re-recording. Projects that already saved a keyboard track pick it up after "Regenerate Keyboard Segments".
  • modifier_prefix now orders modifiers ⌃⌥⇧⌘, the order macOS menus use, instead of ⌘⌃⌥⇧.
  • Both apps build overlays through generate_project_keyboard_segments (the GPUI editor in editor_tabs.rs, the Tauri editor in lib.rs), and exports through synchronize_legacy_keyboard, so they all pick this up.

Testing

  • macos_option_and_right_command_count_as_modifiers fails on main with ["⌘LOPTION", "⌘←"] and passes here. All 149 cap-project tests pass.
  • cargo fmt --check and cargo clippy -p cap-project --all-targets -- -D warnings on the pinned 1.88 toolchain pass.
  • I ran the key logs of a real Cap 0.6.0 Studio recording on macOS (20 clips) through group_key_events on main and on this branch:
Keys pressed Overlays main This PR
⌘ then ⌥ 7 ⌘LOPTION ⌥⌘
⌥⌘ + arrow 23 ⌘← ⌘↑ ⌘→ ⌘↓ ⌥⌘← ⌥⌘↑ ⌥⌘→ ⌥⌘↓
⌥⌘ + digit 11 ⌘2 to ⌘6 ⌥⌘2 to ⌥⌘6
⇧⌘⎋ 2 ⌘⇧⎋ ⇧⌘⎋
  • Not hand-tested in a running GPUI or Tauri build. The overlay text above is what the editor and the exporter render.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Adds macOS Option and right Command recognition to keyboard overlays.

  • Keyboard overlays show macOS Option and Command modifiers in menu order.

Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

…rlays

On macOS device_query reports Option as LOption/ROption and right
Command as RCommand, which the overlay never treated as modifiers.
A held Option leaked into the overlay as "⌘LOPTION" and dropped from
the next combo, so ⌥⌘← read as "⌘←". Modifiers now print in Apple's
⌃⌥⇧⌘ order.
@vercel

vercel Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

@Zingzy is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@richiemcilroy

Copy link
Copy Markdown
Member

Thanks for this! Before we can review it further it needs a Greptile confidence score of 5/5, and Greptile hasn't scored it yet. Could you push an update or ask @greptileai review, then address anything it raises? Once it's at 5/5 we'll run the full CI and regression suites on it.

@Zingzy

Zingzy commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@Zingzy

Zingzy commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@richiemcilroy thanks for your reply.. I just got this re-reviewed by greptile and it seems to have a 5/5 Confidence Score. You can review it further now!

@richiemcilroy

Copy link
Copy Markdown
Member

@greptileai review

@richiemcilroy richiemcilroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified for 0.6.2: Greptile 5/5 on this head, full CI green, and the full test suites pass on macOS with this PR combined with the other 0.6.2 changes.

@richiemcilroy
richiemcilroy merged commit 8a087e2 into CapSoftware:main Oct 26, 2026
50 of 54 checks passed
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.

2 participants