Conversation
|
12ae295 to
9c78d3d
Compare
|
@AprilNEA I rebased my PR and fixed the merged conflicts. Could you take a look at this when you get a chance? I've been using this locally for the past week, and it's working fine. Thanks! |
be0cdb2 to
de3a496
Compare
497de8c to
fc26307
Compare
|
Rebased onto I also closed out the Windows question I'd left in the description rather than leaving it on your plate: I'm not gating here. Divert-but-can't-perform already exists on Windows for Full local gate green on the rebased tip — details in the description. Still running it daily on the MX Mechanical Mini for Mac. |
…brightness actions The MX Mechanical family's backlight up/down keys (0x1b04 CIDs 0x00e2/0x00e3, reported divertable) were previously invisible to OpenLogi: their firmware task adjusts the keyboard backlight internally and no event ever reaches the OS, so neither the OS-hook remapper nor any external tool can rebind them. Logi Options+ diverts exactly these controls and synthesizes display-brightness events; users migrating lose that behavior. Add KeyBacklightDown/KeyBacklightUp slots and BrightnessUp/BrightnessDown actions (macOS: NX system-defined brightness keys; Linux: KEY_BRIGHTNESSUP/ DOWN via uinput; Windows: debug-logged no-op — display brightness is not an input event there). Unbound keys are never diverted, so stock backlight behavior is preserved unless the user opts in. PROTOCOL_VERSION bumps to 30 (appended wire variants, per the v28 HoldShortcut precedent). Verified live on an MX Mechanical Mini for Mac over Bluetooth-direct on macOS: diversion arms, presses dispatch, screen brightness responds.
keyboard_spec_for's `wanted` filter is the only thing keeping an unbound keyboard key native, and nothing tested it. The gate is load-bearing for the backlight pair in particular: diverting 0x00e2/0x00e3 suppresses the firmware's internal backlight adjust, so a key reaching `wanted` without the user binding it would silently cost them backlight control on a key they never touched. Mirrors the mouse-side precedent in capture_plan's bound_wheel_tilt_is_diverted_but_an_untouched_one_stays_native, and also covers Action::None — present in the config as a binding, but not a reason to take a key away from the firmware.
fc26307 to
c7f2c3b
Compare
|
Want your agent to iterate on Greptile's feedback? Start a greploop in Codex and it will work through the open comments and keep going until this PR reviews clean. |
|
Rebased again onto The other conflict was in Full local gate green on the rebased tip; |
Summary
KeyBacklightDown/KeyBacklightUp(0x1b04CIDs0x00E2/0x00E3) as bindable keyboard key slots, plusBrightnessUp/BrightnessDownactions dispatched as media-key effects — macOS NX brightness events, LinuxKEY_BRIGHTNESSUP/DOWN, no Windows key event.Screenshot
The two new actions in the key action picker (MX Mechanical Mini for Mac). The
Key*slots this PR adds are config-only; this panel binds an OS key trigger, and is here to show the actions and their icons.Changes
openlogi-core— twoActionand twoButtonIdvariants, appended last;KEYBOARD_KEYSgrows to 11;default_binding,to_effect, and twoMediaKeyvariants.openlogi-device— the two CIDs joinKEYBOARD_KEY_CIDS, with a test tying it toButtonId::KEYBOARD_KEYSacross the crate boundary.openlogi-inject— macOSNX_KEYTYPE_BRIGHTNESS_UP/DOWN; Linux pressesKEY_BRIGHTNESSUP/DOWNand registers both inKEY_CAPABILITIES; Windows logs and skips.openlogi-ipc—PROTOCOL_VERSION31→32. Neither enum rides the bincode wire; the bump follows the v28 precedent and guards GUI/agent config skew.openlogi-desktop— the actions joinaction_icon_path's exhaustive match.openlogi-ui— 23 locale catalogs,+4keys each at parity-test positions. The brightness actions name the screen so they cannot be read as the keyboard backlight. Mechanical; safe to skim.ButtonIdnames are pinned (they are on-disk map keys), and every0x1b04CID is pinned.Notes for review
Windows: no platform gate here, deliberately. Binding a brightness action on Windows still diverts the CID and suppresses the firmware's backlight adjust while the injector can do nothing. That shape is pre-existing rather than new —
openlogi-inject's Windows backend already skipsSleep,RunAppleScript,CustomShortcut, held-shortcut edges, and pixel scroll the same way. Gating only brightness would leave an inconsistency; gating all of them changes five existing actions and belongs in its own PR at thewanted/dispatch boundary rather than in a feature PR. The mitigation already in this change is thatwanteddiverts only bound keys, so a Windows user loses the firmware function only by deliberately binding that key, and unbinding restores it. Happy to add the narrow gate instead (~10 lines inkeyboard_spec_for) if you would rather have it here.Separately, that filter's
Binding::LongPress(_)arm short-circuits without consulting either action, soLongPress(None, None)diverts and does nothing on any platform. Pre-existing; the new test pins the correct case and leaves that one to your decision.Testing
Rebased onto
b9c8fede. Two conflicts, both from upstream moving: master took v31 forCapabilities::dpi_gestures, so this append is renumbered to v32 (const, doc line, and the pinnedprotocol_version_is_pinnedgolden). The second was inrecord_profile/tests.rs— master had independently replaced the hardcodedv29/v30assertions with derived ones, so I took master's side and that cleanup is no longer part of this PR.Full local gate on the rebased tip,
RUSTFLAGS=-D warnings:cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace(0 failed suites), and the non-GUI rustdoc step. Checklist suites by name:cargo test -p openlogi-ipc --test wire_format(16 passed),cargo test -p openlogi-ui locale,cargo test -p openlogi-desktop i18n.cargo xtask cion macOS/aarch64: 9 passed, 0 failed, 3 skipped. Not run here and not claimed green:shell,tests (linux),cargo-deny. The Linux capability test cannot execute on macOS; the Linuxclippy --all-targetsjob compiles it. This PR touches cfg-gated files inopenlogi-inject(linux.rs,macos.rs,windows.rs), so the Linux and Windows paths are hand-audited only, not runtime-verified.Hardware, on an MX Mechanical Mini for Mac over Bluetooth-direct (macOS 26.6): diversion arms (
keyboard key capture active keys=3), both directions dispatch including key repeat, display brightness responds, and it survives an agent restart. Mouse gestures still work, covering #1183'sgesture.rsrewrite.Field use: this has been my daily driver since 2026-08-28, roughly three weeks, across agent restarts, sleep/wake cycles, a full OS reboot, an Xcode upgrade, and a reinstall that put a stock release build back over it. One multi-hour outage in that window traced to the capture-recovery retry loop rather than to this change, and has since been fixed upstream by #1321.
Not verified: whether quitting the agent hands these CIDs back to the firmware — the test keyboard's backlight is software-disabled, so that function has no observable effect either way (same restore path as the nine existing slots). Linux and Windows are not runtime-tested, and the picker icons were not re-checked visually.
Fixes #1115