Skip to content

Add Keychron Nape Pro layer remaps and per-layer orientation - #29

Merged
snekxs merged 5 commits into
OpenMouse-Project:mainfrom
dwei30:nape-pro
Aug 29, 2026
Merged

Add Keychron Nape Pro layer remaps and per-layer orientation#29
snekxs merged 5 commits into
OpenMouse-Project:mainfrom
dwei30:nape-pro

Conversation

@dwei30

Copy link
Copy Markdown
Contributor

Summary

  • Add Nape Pro VIA keymap get/set: packed GET_BUFFER (cmd 18), SET_KEYCODE (cmd 5), and independent encoder CCW/CW (GET_ENCODER 20 / SET_ENCODER 21). Overlay keys are 01 / 02 / 03 / 04 / M1 / M2; unlabeled column 6 stays hidden.
  • Treat firmware layers as 1–8 (same index as GET_CURRENT_LAYER and Keychron Launcher). UI labels stay 0–7. VIA may report a spare slot at index 0; OpenMouse caps at 8.
  • Add per-layer sensor orientation: GET_LAYER_ORI 56 / SET_LAYER_ORI 57 as [167, 57, layer, index], plus live SET_ORI 52 when writing the active layer. Eight 45° steps (0°–315°).
  • Keep this driver Nape-only (nape-hid.ts, KEYCHRON_NAPE_*). M-series Keychron mice use a different protocol and should not reuse these helpers.

Test plan

  • npm run check in mouse-protocol
  • Wired Nape Pro (3434:0440, firmware v1.2.6-ZK): readLayerKeymap matches Launcher for the current layer
  • setKeycode / setEncoder confirm on readback; CW and CCW can differ
  • Layer 3 remap hits GET_BUFFER offset 14 * 3 (0x2A), not layer-minus-one
  • setLayerOrientation(3, 5) stores 225° on layer 3 and leaves other layers unchanged
  • Writing orientation on the active layer also updates live GET_ORI
  • Link-KM receiver still rejects a non-Nape pairing

snekxs added a commit that referenced this pull request Aug 29, 2026
Combines the M6 PR (#33) and Nape Pro PR (#29), which both branched before
the other landed and independently touched keychron/index.ts and registry.ts.
Retires the generic KeychronHidClient (keychron/hid.ts): nape-hid.ts is a
strict superset of it and both matched the exact same product IDs, so every
Nape Pro device was claimable by two drivers (caught by registry.test.ts).
This matches this PR's own stated intent ("keep the Keychron driver
Nape-only").
Build and full test suite pass (544/544).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@snekxs
snekxs merged commit 5aaed17 into OpenMouse-Project:mainAug 29, 2026
2 checks passed
Sign up for freeto 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

@dwei30@snekxs