Skip to content

keychron: let the M6 set its DPI stage count - #106

Merged
snekxs merged 1 commit into
OpenMouse-Project:mainfrom
ydw1904:feat/keychron-m6-stage-count
Sep 16, 2026
Merged

snekxs merged 1 commit into
OpenMouse-Project:mainfrom
ydw1904:feat/keychron-m6-stage-count

Conversation

@ydw1904

@ydw1904 ydw1904 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What

The M6 now reports `countEditable: true` and implements `setDpiStageCount`, so the shared stage editor shows the stage count picker (1 to 5) instead of hiding it.

Why

The settings packet already carries the stage count at byte 14 and `parseStatus` already reads it back, so the wire format was known. Only the setter was missing, which kept the picker hidden.

Details

  • All five hardware slots keep their DPI; the count only decides how many the DPI button cycles through.
  • The active stage rides on the same packet, so it is clamped below the new count before writing. Shrinking past it would otherwise write a stage the mouse cannot hold.
  • The write is confirmed by reading the settings back; a mismatch throws.

Testing

  • `npm run build` passes
  • `tsx --test src/drivers/keychron/*.test.ts`: 41/41 pass, including new tests for the setter, the active stage clamp, and out of range counts

Not yet exercised on hardware: until now the count field was only ever written back with the value just read. The app needs no change, `applyDpiStageCount` already gates on `countEditable` and `setDpiStageCount`.

The settings packet already carried the count at byte 14 and parseStatus
already read it back, so the wire format was known; only the setter was
missing, which left countEditable false and the stage picker hidden.

The active stage rides on the same packet, so shrinking past it would
write a stage the mouse cannot hold. Clamp it first.

The count write itself has not been exercised on hardware: until now the
field was only ever written back with the value just read.
@snekxs
snekxs merged commit 5e7bb8f into OpenMouse-Project:main Sep 16, 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.

2 participants