Skip to content

Fix/logi bolt macos support#91

Merged
thisislvca merged 4 commits into
TomBadash:masterfrom
vcanuel:fix/logi-bolt-macos-support
Apr 14, 2026
Merged

Fix/logi bolt macos support#91
thisislvca merged 4 commits into
TomBadash:masterfrom
vcanuel:fix/logi-bolt-macos-support

Conversation

@vcanuel

@vcanuel vcanuel commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #59 — Logitech mice connected via a Logi Bolt USB receiver were not detected on macOS.

Root causes:

  • The default HID backend on macOS was iokit-only, which skipped hidapi enumeration — the Bolt receiver's vendor-specific HID++ interfaces (usage_page >= 0xFF00) were never
    discovered
  • A break after failed _divert() stopped the device-index loop at the first non-mouse device (e.g. MX Keys S keyboard on slot 3), preventing discovery of mice on later slots

Changes:

  • Default backend to "auto" on all platforms so hidapi enumerates alongside IOKit
  • On macOS, prefer IOKit for opening devices (non-exclusive access prevents cursor freeze), hidapi as fallback
  • Replace break with continue after divert failure so all receiver slots (1–6) are probed
  • Sort candidates so direct devices (Bluetooth) are tried before USB receivers — avoids ~10s of slot-scan timeouts for Bluetooth users
  • Show connection type ("Bluetooth" / "Logi Bolt") in the UI status badge
  • Update README + README_CN

Testing

Tested on macOS 15 (Apple Silicon) with MX Master 3S For Mac:

  • Logi Bolt (PID 0xC548, receiver slot 4): all HID++ features working — REPROG_V4, DPI, Smart Shift, battery
  • Bluetooth (PID 0xB034, devIdx 0xFF): instant connection, no regression
  • Switching between modes requires an app restart (auto-reconnect on transport change is not yet supported)
  • 226 tests pass (4 new):
    • Divert failure continues to next receiver slot
    • Candidates sorted: direct devices before USB receivers
    • Transport label "Bluetooth" for devIdx 0xFF
    • Transport label "Logi Bolt" for receiver slots 1–6

Screenshots

Status badge shows Connected · Logi Bolt or Connected · Bluetooth depending on transport.

Python 2026-04-12 17 09 06

vcanuel and others added 3 commits April 12, 2026 16:42
The iokit-only backend on macOS could not detect mice connected through
a Logi Bolt USB receiver. Two changes fix this:

1. Default backend preference to "auto" on all platforms so hidapi is
   tried when IOKit enumeration returns no devices.
2. Replace `break` with `continue` after a failed divert so the
   device-index loop keeps scanning receiver slots instead of stopping
   at the first non-mouse device (e.g. a keyboard on an earlier slot).

Tested with MX Master 3S For Mac paired to a Bolt receiver (PID 0xC548)
on macOS — device detected at slot 4, all HID++ features operational.

Closes TomBadash#59

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Default HID backend to "auto" so hidapi enumerates Bolt receiver
  interfaces alongside IOKit
- On macOS, prefer IOKit for opening devices (non-exclusive access)
  to prevent cursor freeze; fall back to hidapi only when IOKit fails
- Continue scanning receiver slots after divert failure instead of
  stopping at the first non-mouse device (e.g. keyboard on slot 3)
- Sort candidates so direct devices (Bluetooth) are tried before USB
  receivers, avoiding slow slot-scan timeouts for BT users
- Show actual connection type (Bluetooth / Logi Bolt) in the UI
  status badge, derived from HID++ device index
- Update README and README_CN to reflect Bolt support

Tested with MX Master 3S For Mac on both Bluetooth and Logi Bolt
(PID 0xC548) on macOS — seamless switching between both modes.

Closes TomBadash#59

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Divert failure continues to next receiver slot
- Candidates sorted: direct devices before USB receivers
- Transport label: "Bluetooth" for devIdx 0xFF, "Logi Bolt" for slots 1-6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TomBadash TomBadash requested a review from thisislvca April 12, 2026 23:50

@thisislvca thisislvca left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The connection fix looks good to me overall. One thing I want to double-check before merge is the new transport label.

Right now we label any non-0xFF devIdx as Logi Bolt. As far as I can tell, that only proves the mouse was reached through a receiver slot, not that the receiver itself is definitely Bolt. In other words, this seems sufficient to distinguish Bluetooth vs receiver-backed, but maybe not enough to specifically claim Logi Bolt.

Could you either:

  • confirm that the receiver can be identified as Bolt from PID / product string / other metadata and keep the current label, or
  • change the fallback label to something safer like USB receiver unless Bolt is positively identified?

If you tweak that part, can you also re-test both Bluetooth and the Bolt receiver once more before we merge?

…ely identified

Previously any non-0xFF devIdx was labeled "Logi Bolt", but that only
proves the device is behind a receiver slot — not that the receiver is
Bolt. Now we check the receiver PID (0xC548, per Solaar) and fall back
to "USB Receiver" for Unifying/Nano/Lightspeed receivers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vcanuel

vcanuel commented Apr 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @thisislvca ! You were right — devIdx != 0xFF only proves the device is behind a receiver slot, not that it's specifically Bolt. I checked the Solaar receiver database and confirmed that 0xC548 is the only Bolt receiver PID (notably, 0xC52B is Unifying, not Bolt).

@thisislvca

Copy link
Copy Markdown
Collaborator

LGTM, thanks

@thisislvca thisislvca merged commit 13b61bd into TomBadash:master Apr 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MX Master 4 not detected on Windows 11

2 participants