Repository navigation
fix(project): show the macOS Option and right Command keys in key overlays - #2657
Conversation
…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.
|
@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. |
|
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 |
|
@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! |
|
@greptileai review |
richiemcilroy
left a comment
There was a problem hiding this comment.
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.
On macOS, keyboard overlays drop the Option key and show its raw name instead. Pressing ⌥⌘← shows
⌘LOPTIONand then⌘←. Right Command is never treated as a modifier, so shortcuts typed with it lose their ⌘.Cause
device_querynames the macOS Option keysLOption/ROptionand right CommandRCommand(device_state/macos/mod.rsin 4.0.1).keycode_to_stringincrates/recording/src/cursor.rshas no arm for them, so the fallback writes those names to the key log as they are.crates/project/src/keyboard.rsonly countsLAlt/RAlt/LMeta/RMeta/Meta/Commandas modifiers. The Option press then goes through the combo branch as an ordinary key and prints as⌘plusLOPTION, and it is missing from the modifier prefix of the next key.Fix
MODIFIER_KEYS,modifier_prefixand the command check ingroup_key_eventsnow includeLOption,ROptionandRCommand.modifier_prefixnow orders modifiers ⌃⌥⇧⌘, the order macOS menus use, instead of ⌘⌃⌥⇧.generate_project_keyboard_segments(the GPUI editor ineditor_tabs.rs, the Tauri editor inlib.rs), and exports throughsynchronize_legacy_keyboard, so they all pick this up.Testing
macos_option_and_right_command_count_as_modifiersfails onmainwith["⌘LOPTION", "⌘←"]and passes here. All 149cap-projecttests pass.cargo fmt --checkandcargo clippy -p cap-project --all-targets -- -D warningson the pinned 1.88 toolchain pass.group_key_eventsonmainand on this branch:main⌘LOPTION⌥⌘⌘←⌘↑⌘→⌘↓⌥⌘←⌥⌘↑⌥⌘→⌥⌘↓⌘2to⌘6⌥⌘2to⌥⌘6⌘⇧⎋⇧⌘⎋

Confidence Score: 5/5
The PR appears safe to merge.Summary
Adds macOS Option and right Command recognition to keyboard overlays.
Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile