Skip to content

feat: command for mac binds - #220

Open
seankmartin wants to merge 10 commits into
masterfrom
feat/mac-use-command-for-control-binds
Open

seankmartin wants to merge 10 commits into
masterfrom
feat/mac-use-command-for-control-binds

Conversation

@seankmartin

@seankmartin seankmartin commented Aug 12, 2026 •

Copy link
Copy Markdown

Adds cmd as an additional bind on mac for all previous cases where control only worked. Explored cmd as the only bind but I think that's not a good idea as users may have gotten muscle memory in using control.

Show Cmd rather than Ctrl in tooltips describing modifier+click bindings,
matching what the Cmd-as-Ctrl remap in dispatchEventWithModifiers makes the
user actually press.

Left untouched: layer_bar.ts, segmentation_display_state/frontend.ts, and
drag_and_drop.ts have Ctrl/Alt-only click handlers with no Cmd/Option
equivalent implemented at all; fixing those requires adding new functional
behavior.

(cherry picked from commit 0305e21)
getDropEffectFromModifiers accepted only Ctrl to force a "move" drop, which
is unusable on Mac where Ctrl+click is the system secondary-click gesture.
Accept Cmd there instead, and name the modifier accordingly in the drag
status message. savedModifiers already captured metaKey, so the Wayland
workaround needs no change.

The segment list and add-layer tooltips were label-only: Option and Cmd
already worked, the text just named the wrong keys.

The tool palette dropdown button advertised "control+click to create new",
but its CheckboxIcon ignores modifiers and no create-new path exists, so
the hint was inaccurate on every platform.  Drop it.
This is a more opinionated choice than allowing both
But on mac usually control + click is bound to right click
And it also feels a bit less hacky to dispatch the event
with meta key instead of when the event is handled to
pretend that control is meta.
Now explicitly bound meta + key combos will be found first
and fallback to checking on mac if any ctrl + key combo is
found and uses that one if so
@seankmartin
seankmartin marked this pull request as ready for review September 19, 2026 17:24
Comment thread src/ui/command.ts

const MAC_MODIFIER_SYMBOLS: Partial<Record<string, string>> = {
control: "⌘",
meta: "⌘",

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.

potential issue: I don't think there's any integration that uses control + X for action A and meta + X for action B. If there was, then we would get a weird UI indication on macs.

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