Skip to content

feat(hid): support MX Mechanical extra controls - #1248

Open
Soren90912 wants to merge 2 commits into
AprilNEA:masterfrom
Soren90912:feat/mx-mechanical-extra-controls
Open

feat(hid): support MX Mechanical extra controls#1248
Soren90912 wants to merge 2 commits into
AprilNEA:masterfrom
Soren90912:feat/mx-mechanical-extra-controls

Conversation

@Soren90912

@Soren90912 Soren90912 commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Add native HID++ support for the extra programmable controls on the full-size MX Mechanical keyboard.

The Calculator, Show Desktop, Search, and Lock PC positions can now be configured through OpenLogi while leaving unbound controls on their native firmware behavior.

This also fixes dev-profile tray commands opening the production OpenLogi GUI when both bundles register the openlogi:// URL scheme.

Changes

  • core

    • Add KeyCalculator, KeyShowDesktop, and KeyLockPC as append-only ButtonId variants.
    • Keep the new controls unbound by default so firmware-native behavior is preserved.
    • Add config round-trip coverage for device-level keyboard bindings.
  • device

    • Add the MX Mechanical HID++ control IDs:
      • Calculator: 0x000a
      • Show Desktop: 0x006e
      • Search: 0x00d4
      • Lock PC: 0x006f
  • gui

    • Map the MX Mechanical F16-F19 diagram positions to their HID++ device controls.
    • Keep high function-key positions global on unrelated keyboards.
    • Add Custom Shortcut editing for the keyboard action picker.
    • Show the physical position together with the Logitech control name, e.g. F16 · Calculator Key.
  • ipc

    • Bump PROTOCOL_VERSION from 29 to 30 for the appended ButtonId variants.
    • Update wire-format coverage.
  • i18n

    • Add labels for Calculator, Show Desktop, and Lock PC controls across all locale catalogs.
  • agent

    • Route tray deeplinks to the GUI bundle matching the running agent profile.
    • Prevent a dev agent from opening or treating the production GUI as its own.
    • Remove the no-longer-needed opener dependency.

Testing

  • cargo fmt --all -- --check
  • RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets -- -D warnings
  • RUSTFLAGS="-D warnings" cargo test --workspace
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agent
  • cargo test -p openlogi-ipc --test wire_format
  • cargo test -p openlogi-ui locale
  • cargo test -p openlogi-desktop i18n

Hardware tested on a full-size MX Mechanical on macOS:

  • F16 / Calculator → Ctrl+Alt+N — verified
  • F17 / Show Desktop → Ctrl+Alt+L — verified
  • F18 / Search left unbound — native behavior preserved
  • F19 / Lock PC left unbound — native behavior preserved
  • Dev tray Settings command verified to open the dev-profile GUI rather than the installed production app

Screenshots

F16 / Calculator with a custom shortcut:
F16

F17 / Show Desktop with a custom shortcut:
F17

@Soren90912
Soren90912 force-pushed the feat/mx-mechanical-extra-controls branch from 1feacf6 to 6c0ac93 Compare September 2, 2026 14:23
@Soren90912
Soren90912 marked this pull request as ready for review September 2, 2026 14:49
@Soren90912
Soren90912 requested a review from AprilNEA as a code owner September 2, 2026 14:49
@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds device-scoped HID++ bindings for the MX Mechanical’s Calculator, Show Desktop, Search, and Lock PC controls, while preserving native behavior when unbound.

  • Adds append-only button identifiers, HID++ control mappings, defaults, localization, configuration coverage, and an IPC protocol-version bump.
  • Updates the keyboard editor to distinguish global function-key triggers from per-device HID++ controls and adds custom-shortcut editing.
  • Routes macOS tray deeplinks to the production or development GUI bundle matching the running agent profile.

Confidence Score: 5/5

The PR appears safe to merge; no concrete blocking or independently actionable non-blocking issue remains.

The new controls follow the established per-device persistence and capture path, model detection uses the firmware’s all-transport identifier set, IPC compatibility is versioned, and profile-specific tray routing matches packaged bundle identities.

Important Files Changed

Filename Overview
crates/openlogi-desktop/src/features/keyboard/function_row.rs Maps MX Mechanical F16–F19 positions to per-device HID++ controls while retaining global bindings for unrelated keyboards.
crates/openlogi-desktop/src/features/keyboard/editors.rs Generalizes editor commits across global and device targets and adds custom-shortcut text editing.
crates/openlogi-device/src/session/keyboard.rs Extends the keyboard capture catalog with the MX Mechanical Calculator, Show Desktop, and Lock PC control IDs.
crates/openlogi-core/src/binding/button.rs Appends three serialized button variants and exposes their labels and localization keys.
crates/openlogi-agent/src/tray.rs Pins macOS deeplink delivery and running-GUI checks to the bundle matching the agent’s active profile.
crates/openlogi-ipc/src/ipc.rs Bumps the strict IPC protocol version for the append-only serialized enum expansion.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  User[User selects MX Mechanical control] --> UI[Keyboard action picker]
  UI --> Target{Binding target}
  Target -->|Ordinary F-key| Global[Global keyboard binding]
  Target -->|MX Mechanical extra control| Device[Per-device HID++ binding]
  Device --> Config[Persist configuration]
  Config --> Agent[Reload agent capture plan]
  Agent --> HIDPP[Divert configured HID++ control]
  HIDPP --> Action[Dispatch configured action]
  Device -->|Action None| Native[Preserve firmware-native behavior]
Loading

Reviews (1): Last reviewed commit: "fix(tray): route commands to matching ap..." | Re-trigger Greptile

@davidbudnick davidbudnick added type: feature New feature request area: gui Graphical user interface area: hidpp HID++ protocol and device feature support platform: all Cross-platform issue labels Sep 3, 2026
@Soren90912

Copy link
Copy Markdown
Author

The only failing CI leg appears to be the macOS Intel test job. I reproduced the same failure locally with the x86_64 target in tray::tests::startup_stays_suspended_when_the_display_is_already_asleep (crates/openlogi-agent/src/tray.rs:610), then reran that exact test in isolation and it passed. The sleep/wake logic exercised by this test is not changed by this PR; the PR only changes the tray GUI bundle-routing path in this file. This looks like an existing Intel/macOS timing flake rather than a regression from these changes. I do not have permission to rerun the upstream workflow; could a maintainer please rerun the failed macOS x86_64 job?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: gui Graphical user interface area: hidpp HID++ protocol and device feature support platform: all Cross-platform issue type: feature New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants