Skip to content

fix(native-hid): open only the config collection of Lamzu's CompX receivers - #141

Open
imskaff wants to merge 1 commit into
OpenMouse-Project:mainfrom
imskaff:fix/lamzu-atlantis-config-collection
Open

imskaff wants to merge 1 commit into
OpenMouse-Project:mainfrom
imskaff:fix/lamzu-atlantis-config-collection

Conversation

@imskaff

@imskaff imskaff commented Dec 1, 2026 •

Copy link
Copy Markdown

Summary

Bridge could not read a Lamzu Maya through its 4K receiver (3554:f510) on Windows, so the tray battery and native profile writes failed whenever no OpenMouse tab held the session.

It is the same receiver behaviour ONLY_USAGE_PAGE already handles for Scyrox: with every vendor collection of interface 1 open, the receiver stops answering on its 0xff02 config collection.
This extends that rule to Lamzu devices on CompX's vendor id 0x3554 (the Atlantis generation, which includes the Maya).
Lamzu's 0x373e and 0x37b0 models talk through feature reports on other collections, so the rule is keyed by vendor id and leaves them opened whole.

ONLY_USAGE_PAGE becomes a small rule list with an optional vendor id, read through onlyUsagePageFor(driver, described); the Scyrox behaviour is unchanged.

Evidence (Windows 10, Maya firmware 1.24, receiver release 0x0128)

The real LamzuAtlantisHidClient, called through this package's own adapters:

Collections opened readStatus()
All 7 non-standard paths (current behaviour) 0 of 6, "Command 0x04 got no answer"
Only 0xff02 6 of 6, about 90 ms each

Order was reversed in a second run with the same result, and a direct read on 0xff02 answered immediately before and after, so the misses are not the mouse sleeping.

Installed Bridge 1.0.4 (per-user installer, debug log):

  • Stock: every native battery poll failed with no Lamzu device answered ... Command 0x04 got no answer on Lamzu:3554:f510 (0 of 5).
  • With this registry.mjs (and the matching protocol build): polls recorded the mouse natively, "native": true, 3 of 4 on restart plus later polls while in use; the one miss was a single first poll that two more runs did not repeat.

The OpenMouse web app using Bridge as its transport already worked before this change (Rust side), so it is unaffected.

Related

Checks

  • npm test in native-hid: 47 of 47 pass, including two new tests (the rule table, and a Lamzu receiver on 0x3554 opening only its 0xff02 path).
  • Note for local setup: npm ci here currently fails building the git-pinned @openmouse/keyboard-protocol v1.8.0 (src/drivers/wuque/hid.ts(1251,5): Type 'Timeout' is not assignable to type 'number'); I tested with the published npm build of the same version overlaid with --no-save.

Note

Restrict Lamzu CompX receivers to their 0xff02 config collection in native-hid

  • Replaces the brand-to-usage-page map in registry.mjs with rules that match Scyrox by brand and Lamzu by vendor ID 0x3554
  • Adds and exports onlyUsagePageFor, which normalizes the driver brand via brandKey, matches the first rule, and returns its usage page (0xff02) or undefined
  • registryPairs now passes the usage-page restriction from onlyUsagePageFor(driver, described) to the Adapter, so only matching Lamzu CompX receivers and Scyrox devices open their config collection
  • Behavioral Change: Lamzu devices with vendor IDs other than 0x3554 (e.g. 0x373e, 0x37b0) now receive no usage-page restriction; previously all Lamzu-branded devices were narrowed to 0xff02

Macroscope summarized 87f7736.

Summary by CodeRabbit

  • Bug Fixes
    • Improved device detection for Scyrox and eligible Lamzu devices, applying the correct usage-page restriction based on device details.
    • Lamzu devices that don’t meet the vendor requirement and Keychron devices remain unrestricted.
    • Corrected pairing for eligible Lamzu devices so only the appropriate notification path is opened.

…eivers

A Lamzu Maya behind its 4K receiver (0x3554:0xf510) answered 0 of 3 status
reads on Windows while every vendor collection was open, and 3 of 3 with
only 0xff02, the same behaviour the Scyrox dongle rule already handles.
Narrowing applies to Lamzu devices on CompX's 0x3554 only; Lamzu's 0x373e
and 0x37b0 models use feature reports and stay opened whole.
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The registry now supports a Lamzu usage-page restriction for vendor ID 0x3554. It resolves restrictions by normalized driver brand and vendor ID, then applies the result when constructing adapters. Tests cover rule matching and the paired Lamzu path.

Changes: Usage-page rule resolution

Layer / File(s) Summary
Resolve and apply usage-page rules
native-hid/src/registry.mjs, native-hid/src/registry.test.mjs
The registry adds a vendor-specific Lamzu rule and resolves usage-page restrictions using the driver brand and described device. Adapter construction uses the resolved restriction. Tests cover Lamzu, Scyrox, and Keychron rules, and verify the paired Lamzu path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: snekxs, macroscopeapp

Merge Risk: Minimal · up to 87f77

This change makes Lamzu receivers with vendor ID 0x3554 open only the configuration collection, which should fix failed native battery reads and profile writes. Other Lamzu vendor IDs and the Scyrox behavior are unchanged. The change is narrowly scoped and covered by tests, and I see no remaining merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: Lamzu CompX receivers (vendor ID 0x3554) now open only the 0xff02 config collection. The raw summary and objectives both confirm this is the primary change, with the S…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Lamzu CompX receivers (vendor ID 0x3554) now open only the 0xff02 config collection. The raw summary and objectives both confirm this is the primary change, with the Scyrox behavior unchanged. The title is specific, concise, and follows a conventional-commit style.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d175004 and 87f7736.

Files selected for processing: 2

  • native-hid/src/registry.mjs
  • native-hid/src/registry.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions github-actions Bot added type: bug PR title category: bug area: devices HID access and device drivers labels Dec 1, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 1, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at 87f7736

Macroscope's review found this PR approvable — Limits CompX-based Lamzu receivers to their configuration collection while preserving other devices’ behavior. The change reuses existing filtering and is supported by targeted tests and reported Windows hardware results.

Notes:

  • Your repo's Minimum Blocking Severity is Off, so correctness findings do not automatically block approval.

You can add or adjust custom eligibility rules. Learn more.

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

Labels

area: devices HID access and device drivers type: bug PR title category: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant