Repository navigation
Conversation
|
|
Nice work. Heads-up on overlap: #949 covers part of this ( One gap I couldn't rule out from the diff: If this lands first I'll close #949, or cut it down to just that filter on top of yours if it's still needed. |
Adapted from AprilNEA#949. Co-authored-by: RisenID <94130108+RisenID@users.noreply.github.com>
Thanks for looking this over, and for the pointers to #949 and #950. Yes, drawing the side and front renders together puts the middle-click marker on the front render for the G502 LIGHTSPEED. You're right about the gap. Rather than work around it, I took your approach from #949 and adapted it to this branch. It's in
One difference from #949: Not carried over: the diagnostics output and the fixture updates. The agent captures nothing through With that in, I think #949 can be closed as you offered. If I dropped something you want kept, say so and I'll add it. The second commit, |
|
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. |
Summary
Full support for the G502 LIGHTSPEED (wpid
0x407f, receiverc539): every button can be remapped, including G6–G9 and the wheel tilts. It also adds G-Shift, report rate, and onboard-profile selection.G-series mice have no
0x1b04ReprogControls. When a binding, the report rate or G-Shift needs it, the agent switches the mouse into0x8100host mode. It then mutes the captured buttons in the0x8110mapping and dispatches them from0x8110spy reports. Nothing is written to flash. Stopping the agent, or power-cycling the mouse, returns it to its onboard profile.All protocol facts were verified on hardware: the spy bit layout, the mode and profile functions, the report rate being writable only in host mode, and native buttons in host mode.
Changes
OnboardProfiles(0x8100): info, mode, current profile, memory read, profile directory and names.MouseButtonSpy(0x8110): button count, start/stop spy, mapping, event decode.ButtonId::G6–G9.NextDpiPreset,PreviousDpiPreset,DpiShift(hold) andGShift(hold, offered only on G-series mice).GamingLayoutfor the G502 LIGHTSPEED: spy bit → button, host-silent slots, stock DPI presets.Capabilities::{report_rate, onboard_profiles, button_spy}.onboard_memory,report_rateandgshift_bindings, plusConfig::effective_onboard_memory. An explicit choice wins; otherwise host mode is implied by a rebound host-only button, the report rate or G-Shift.ButtonDown/ButtonUp. The session re-arms after a reconnect, and restore leaves host mode.get_onboardread.ReceiverFullwhen the receiver has no free slot.DpiShiftrestores the DPI that was active before the press once the last held press ends, even when that DPI isn't a preset.WriteOrder.read_onboardRPC.PROTOCOL_VERSION36. Newread_onboard,HidppOperation::ReadOnboard(appended after the pointer-scaling operations from feat(hidpp): implement pointer motion scaling #1347) andPairingFailure::ReceiverFull. Goldens regenerated.slotIdpixel markers; side markers only appear when the side image loads. It also gets a Normal | G-Shift bindings switch.openlogi diag onboard.device_siderender and G-number slot parsing.Commits
The feature is one commit, and each later fix (mostly from review) is its own commit:
feat: add G502 LIGHTSPEED supportfix(ui): add the G502 strings to Czechfix(agent): order DPI writes per device, outside the write timeoutfix(agent): restore the pre-shift DPI after the last DPI shift endsfix(agent): keep G-Shift on until every shift button is releasedfix(agent): apply the G-Shift layer to gesture buttonsfix(device): fail arming when the mouse rejects a profile or report ratefix(desktop): show the report rate the mouse reports after a changefix(desktop): fit the onboard card and show the profile's report ratefix(desktop): draw side-view markers only when the side image loadsfix(agent): reinstall the Linux hook only once a device appearsTesting
All pass on Linux (Fedora 44), along with CI's
cargo docstep, typos and ast-grep. Every commit builds and passes clippy and the wire-format test on its own, and every fix commit passes the locale parity test. The feature commit alone misses the Czech strings, which the next commit adds. Clippy also passes for Windows (MSVC) and macOS onopenlogi-core,openlogi-hidpp,openlogi-deviceandopenlogi-agent-core; nothing was run on either.Hardware-verified on a G502 LIGHTSPEED over its Lightspeed receiver, on Fedora 44 with KDE Wayland. The dev agent ran with
OPENLOGI_PROFILE=devand the agent log at debug; mode, profile, DPI and rate were read back over HID++.InvalidArgument. The session retries and the mouse stays on its onboard profile; the GUI shows the mouse's real 1000 Hz.DpiShift: one write to 400 DPI, restored to 1200 (not a preset) only after both are released. Tapping G6 six times quickly always ends at 1200.InvalidArgumentand the session retries. Profiles 1 and 5 switch, and the GUI's report rate updates from 500 Hz to 1000 Hz.openlogi diag onboardlists the mode, profiles with names, and supported rates.Not tested: the G502 over USB, and other G-series models (only this model has a verified layout).
How to test
openlogi diag onboardprints the mouse's state.Screenshots
Relates to #886, #730. Scroll Up/Down actions not scrolling on Linux is a separate bug, fixed in #1719.

