Skip to content

feat(core): add a Super modifier to custom shortcut chords - #1387

Open
sungyongcho wants to merge 2 commits into
AprilNEA:masterfrom
sungyongcho:feat/custom-shortcut-super-modifier
Open

sungyongcho wants to merge 2 commits into
AprilNEA:masterfrom
sungyongcho:feat/custom-shortcut-super-modifier

Conversation

@sungyongcho

@sungyongcho sungyongcho commented Sep 14, 2026

Copy link
Copy Markdown

Summary

CustomShortcut / HoldShortcut chords have no way to press the platform logo key. Cmd (and its Meta / Win aliases) is folded into Control on Linux and Windows, so a chord like Super+End cannot be written, and every GNOME / KDE shortcut that is bound to Super is out of reach from a mouse button. This adds a distinct Super modifier that always presses the logo key: KEY_LEFTMETA on Linux, the Windows key on Windows, Command on macOS.

Cmd keeps its current cross-platform meaning, so existing configs are unchanged.

Changes

  • openlogi-core: KeyCombo gains MOD_SUPER (bit 4), has_super(), the Super parser token, and Super in rendered_label(). Meta / Win stay aliases of Cmd. Wire deserialization accepts the new bit through ALL_MODIFIERS. New test parses_super_as_its_own_modifier.
  • openlogi-inject: Super in immediate chords maps to KEY_LEFTMETA on Linux, VK_LWIN on Windows, and CGEventFlagCommand on macOS. For HoldShortcut chords, Linux and Windows get a HeldKey::Super owner; on macOS the logo key is Command, so Super chords own the existing HeldKey::Command — one physical key, one owner, the same way Cmd and Ctrl already share HeldKey::Control on Linux/Windows. Tests cover both shapes (super_and_command_share_one_physical_output, super_plus_command_owns_the_physical_key_once, super_is_distinct_from_control).
  • docs: CONFIGURATION.md documents the chord modifiers and what Cmd vs Super press on each platform.

Testing

Local gate on Linux (Ubuntu 26.04, rustc 1.98.1):

cargo test -p openlogi-core -p openlogi-inject
cargo xtask ci
cargo xtask ci clippy-windows

cargo xtask ci: rustfmt, publish closure, clippy, MSRV (linux), rustdoc (non-GUI crates), tests (linux), wasm — all pass. clippy-windows (the x86_64-pc-windows-gnu proxy) passes. Not run on this host: typos, shell, tests (macos), cargo-deny. The macOS cfg block was hand-audited against master (every HeldKey match stays exhaustive) but was not compiled.

Hardware: runtime-tested on Linux (GNOME 50, Wayland) with an MX Master 3 over a Bolt receiver. Gesture button Left = { CustomShortcut = "Super+Shift+Left" } / Right = "Super+Shift+Right" moves the focused window between monitors, and Super+End reaches GNOME's "move to last workspace". Not runtime-tested on macOS or Windows.

Fixes #724

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previously reported macOS held-key aliasing problem is resolved and no new actionable issues were found.

Summary

Adds a distinct Super modifier for custom shortcut chords while preserving the existing cross-platform behavior of Cmd, Meta, and Win.

  • Extends KeyCombo parsing, serialization validation, labels, and tests.
  • Maps Super to the platform logo key across Linux, Windows, and macOS.
  • Shares physical-key ownership between Super and Command on macOS to prevent duplicate or premature held-key transitions.
  • Documents platform-specific modifier behavior.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Config["Shortcut configuration"] --> Parser["KeyCombo parser"]
    Parser -->|"Super bit"| Injector{"Platform injector"}
    Injector -->|"Linux"| Linux["KEY_LEFTMETA"]
    Injector -->|"Windows"| Windows["VK_LWIN"]
    Injector -->|"macOS"| Mac["Command flag / HeldKey::Command"]
Loading

Reviews (5) · Last reviewed commit: "fix(inject): share the Command owner bet..."

Comment thread crates/openlogi-inject/src/inject/macos.rs Outdated
@davidbudnick davidbudnick added type: feature New feature request platform: all Cross-platform issue labels Sep 14, 2026
@sungyongcho
sungyongcho force-pushed the feat/custom-shortcut-super-modifier branch from e3cb447 to ba405d0 Compare September 15, 2026 08:22
@sungyongcho
sungyongcho force-pushed the feat/custom-shortcut-super-modifier branch from b627887 to a30bbc1 Compare September 15, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: all Cross-platform issue type: feature New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: ShortCut

2 participants