Conversation
CustomShortcut's config parser already accepted "cmd"/"command"/"meta"/"win" as aliases for one cross-platform modifier bit, but Windows and Linux injection silently folded that modifier into Ctrl instead of the actual Windows/Super key — so "Cmd+Down" sent Ctrl+Down (or, combined with an explicit Ctrl in the chord, just deduplicated into a single Ctrl), never the Windows key or Super/Meta a Wayland/X11 compositor binds shortcuts to. Give Cmd its own physical output on every platform: VK_LWIN on Windows, KEY_LEFTMETA on Linux (already a registered virtual-device capability, just unused for CustomShortcut), matching macOS's existing Cmd/Ctrl distinction. Also accept "super" as a parser alias, alongside the existing "meta"/"win". Fixes AprilNEA#893
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CustomShortcut's config parser already acceptedcmd/command/meta/winas aliases for one cross-platform "Command" modifier bit, but Windows and
Linux injection silently folded that modifier into Ctrl instead of the
actual Windows-key/Super — so
Cmd+DownsentCtrl+Downon Windows (or,combined with an explicit
Ctrlin the same chord, deduplicated into asingle Ctrl press), and never the Super/Meta key a Wayland/X11 compositor
binds shortcuts to on Linux. Six separate user reports across Windows and
Linux confirmed the same mechanism.
superas an accepted parser alias, alongside the existingmeta/win— a Linux reporter notedSuper+Xwas rejected outright and,worse, made the whole config fail to parse.
Changes
crates/openlogi-inject/src/inject.rs: the sharedHeldKey::Commandvariant is no longer macOS-only;
held_keys()now pushesCommandforhas_command()andControlforhas_control()independently on everyplatform, instead of folding Command into Control on Linux/Windows.
crates/openlogi-inject/src/inject/windows.rs:combo_modifiersmapshas_command()toVK_LWIN(the Windows key) instead ofVK_CONTROL;held_virtual_keygets a matchingHeldKey::Command => VK_LWINarm.crates/openlogi-inject/src/inject/linux.rs:modifiers_to_keycodesmapshas_command()toKEY_LEFTMETA(Super) instead of folding it intoKEY_LEFTCTRL;held_keycodegets a matching arm.KEY_LEFTMETAwasalready a registered virtual-device capability (used by the LockScreen
Super+L fallback), just unused for
CustomShortcut.crates/openlogi-core/src/binding/key_combo.rs: acceptsuperas a parseralias for the Command modifier.
Testing
cargo test -p openlogi-core -p openlogi-inject— updated/added tests:command_meta_win_and_super_are_the_same_modifier(parser), a rewrittencommand_and_control_are_distinct_physical_outputs/shared_command_stays_down_until_its_last_chord_ends(now exercised onevery platform instead of macOS-only), and new
cmd_maps_to_the_windows_key_distinct_from_ctrl/win_and_meta_and_super_are_accepted_aliases_for_cmd(Windows),cmd_maps_to_super_distinct_from_ctrl/super_and_meta_are_accepted_aliases_for_cmd(Linux).cargo check/cargo clippy --target x86_64-pc-windows-gnufor the Windowscfg-gated code (this host has no Windows runtime to execute tests on, but
the Linux-equivalent logic is unit-tested and the two implementations are
structurally identical).
cargo fmt --all -- --checkRUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets -- -D warningsRUSTFLAGS="-D warnings" cargo test --workspaceRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agentproven by the unit tests above and cross-compilation for Windows; a
maintainer with a Windows or Wayland/X11 machine can confirm
Cmd+Downnow sends the actual Windows/Super key.
Fixes #893