Skip to content

feat: support the logitech g700 (hid++ 1.0, onboard profiles) - #2657

Open
Rufim wants to merge 46 commits into
AprilNEA:masterfrom
Rufim:feat/g700-support
Open

Rufim wants to merge 46 commits into
AprilNEA:masterfrom
Rufim:feat/g700-support

Conversation

@Rufim

@Rufim Rufim commented Nov 26, 2026

Copy link
Copy Markdown

Summary

Adds support for the Logitech G700 (HID++ 1.0, Nano receiver c531 or on its cable). It shows up in the inventory, its DPI, report rate and battery work, and its buttons and five onboard profiles are configured in the mouse's own flash memory. Actions the firmware can't run itself fall back to the agent.

Changes

  • device-registry: G700 identity (receiver c531, wireless 1023, wired c06b) as the single owner of "is this address a G700", with an ast-grep guard.
  • hidpp: HID++ 1.0 onboard-memory reads, the G700 profile/directory codec, guarded page writes (factory profile during the write, read-back, then reselect), and the register setters (0x0F, 0x63, 0x64, 0x07).
  • device / hid: G700 recognition and probing, DPI / report rate / battery over HID++ 1.0, profile edits (activate, enable, disable, rename, duplicate, DPI modes), button sync into flash.
  • core: the G700 gaming layout, flash binding plans with agent-run fallbacks, and per-profile bindings in config.toml.
  • agent-core / agent: flash write queue with retry, per-profile binding sync when the mouse switches profile, and a G700 in the mock agent.
  • ipc: read_flash_profiles / edit_flash_profiles and the new wire types (appended; goldens updated).
  • cli: openlogi diag g700 dump | restore | set-dpi | set-rate | set-resolution | set-profile (documented in docs/USAGE.md).
  • gui: onboard profile management card, DPI and report rate persistence, G700 button editor; a profile name stored with its UTF-16 high bytes lost is shown as "Profile N" and flagged for renaming.
  • i18n: new strings in every locale.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -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 xtask ci ast-grep typos "publish closure" i18n wire_format "wasm (portable crates)": pass
  • Not run: clippy (windows) (no mingw cross compiler on this host), cargo-deny (not installed; the diff adds no new crates), the macOS and Windows test jobs.

Hardware (Linux, G700 on its Nano receiver next to an MX Master 3S on Bolt): openlogi list and the GUI show the G700 with its battery; diag g700 dump --out produced a backup with valid CRCs; renaming three profiles and switching the active one through the agent wrote flash that a fresh dump read back with valid CRCs. DPI and report-rate flash writes are covered by the simulator tests only. The G6–G11 physical positions in the layout are not cross-checked against the hardware yet. Not tested on macOS or Windows, and not tested wired.

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The latest changes appear safe to merge; no new actionable issue was established.

Summary

Adds G700 discovery, onboard-profile editing, guarded flash writes, and button bindings that run on the mouse or through the agent.

  • OpenLogi recognizes G700 mice and reads and writes their onboard settings.
  • The GUI and CLI can manage and inspect G700 onboard profiles.
  • Each G700 profile can have its own button bindings and agent-run actions.
  • The agent queues G700 flash changes and carries each write through to completion.
  • The G700 device view shows its profile controls and keeps pointer settings with the active profile.

Diagram

sequenceDiagram
    participant User
    participant Desktop
    participant Agent
    participant Mouse
    User->>Desktop: Change DPI
    Desktop->>Agent: SetDpi
    Agent->>Mouse: Set live DPI
    Agent->>Agent: Queue profile save
    Agent-->>Desktop: Success
    Desktop->>Desktop: Lock preset edits
    loop Until later readings settle the save
        Desktop->>Agent: ReadFlashProfiles
        Agent-->>Desktop: Profiles and write state
    end
    Desktop->>Desktop: Unlock preset edits
Loading

Reviews (11) · Last reviewed commit: "fix(gui): keep g700 dpi presets from und..." · Reviewed by Greptile

Comment thread docs/USAGE.md Resolved
@davidbudnick davidbudnick added type: feature New feature request platform: all Cross-platform issue area: assets Icons, images, and bundled assets area: cli Command-line interface area: config Configuration files, persistence, and settings area: gui Graphical user interface area: hid HID device discovery, permissions, reads, or writes area: hidpp HID++ protocol and device feature support labels Nov 30, 2026
@Rufim
Rufim force-pushed the feat/g700-support branch from 02c5875 to b82ab08 Compare November 30, 2026 09:05
@Rufim

Rufim commented Dec 1, 2026

Copy link
Copy Markdown
Author

review please

Rufim added 27 commits December 3, 2026 15:23
The action picker stopped its raw mouse buttons at 8, although the flash
writes any button up to the report's 16 and the mouse's own profiles press
past 8 (a G700 default presses button 11). A user could read such a binding
back but not create one.

REPORT_BUTTONS_MAX now owns the count; the validator, the mask decoder, the
agent-button range and the picker all read it, and an ast-grep rule fails on
another literal 1..=16 range. Writing a button the picker offers still
leaves the agent its routing numbers: the planner routes slots around the
buttons a profile presses natively.
…atively

With the picker offering every report button, a profile can press a
button natively that another profile's agent-run slot still owns. The hook
kept routing it to that other slot and ran its action over the press.

hook_routes now drops another profile's route for any button the played
profile presses; that profile's next write moves its slot off the button,
which the planner then finds reserved.
Master now keys every OS-hook press by its source device and cancels a
press whose attribution is lost (AprilNEA#1442). The flash-button path still used
the unkeyed press API, so it no longer compiled.

The flash path now presses, releases and starts its runtime press with the
device, and the cancellation of invalidated sources runs before any early
return: the event that reports a lost G700 may itself be unattributed, and
an agent button is no button the generic path handles.
@Rufim
Rufim force-pushed the feat/g700-support branch from e94e478 to f7f803d Compare December 3, 2026 12:30
The preset chips of a G700 are its played profile's DPI modes as last read.
A DPI the mouse took is saved to one of those modes by a flash write the
agent debounces, yet nothing read the profiles again, and a preset added or
removed meanwhile sent the old list whole, writing the old mode back over
the save. A DpiModes edit answered by the agent had the same gap.

FlashEdits now waits after a DPI save or a DpiModes edit for a reading that
shows it: the write seen and then idle, or two idle readings, the second
begun after the answer. The profiles are polled while it waits, the agent
leaving restarts the wait, and the preset chips offer no add or remove until
it ends; the edit path already refuses an edit while one is busy.

This branch has not been deployed

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

Labels

area: assets Icons, images, and bundled assets area: cli Command-line interface area: config Configuration files, persistence, and settings area: gui Graphical user interface area: hid HID device discovery, permissions, reads, or writes 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