Skip to content

feat(ajazz): driver for the NJ07 and NJ08 family - #177

Merged
snekxs merged 1 commit into
OpenMouse-Project:mainfrom
ydw1904:feat/ajazz-nj07-mc
Oct 8, 2026
Merged

snekxs merged 1 commit into
OpenMouse-Project:mainfrom
ydw1904:feat/ajazz-nj07-mc

Conversation

@ydw1904

@ydw1904 ydw1904 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Requested for the AJAZZ NJ07 MC in a Discord support ticket (0156). The reporter found the vendor's WebHID panel, https://nacodex.yjx2012.com/, and this driver is written from its JavaScript.

What the mice are

The panel's "V1" device class speaks the same command family as the K-snake X11 with a different frame. Output report 0xF0 with 63 body bytes, replies that echo the command at data[0], and different header bytes (read config 0E 01 0B 2E, write config 0F 01 0A 2F). The config block offsets match the K-snake's once the report id is stripped. Control collection is usage page 0xFF01, usage 0x10, on VID 0xA8A4 (wired) and 0xA8A5 (2.4 GHz dongle).

Claimed product ids: 0x2157 NJ07, 0x2158 NJ08, 0x2167 NJ07 MC, 0x2168 NJ08 MC, 0x2177 NJ07 MC PRO, 0x2178 NJ08 MC PRO. 0x2255 stays with the K-snake driver: it is shared with the K-snake X11 and the NJ07/NJ08 V2 and Ultra, and telling them apart needs a descriptor dump.

What this adds

  • src/ajazz/index.ts: constants, one encode/decode per field, the config block codec.
  • src/drivers/ajazz/hid.ts: AjazzHidClient. Identity, battery, firmware, DPI stages (read, edit one stage, pick the active stage), polling rate, sleep timer, scroll direction. Replies are matched by echoed command because the mouse also pushes DPI and battery reports unprompted. SET rewrites the whole block, so each setter reads the block, patches one field, writes, then reads back and fails if the mouse kept the old value.
  • Registry, discovery filters, brand type, ./ajazz export and tsconfig path, README row, docs/ajazz-nj07.md.
  • Tests built from the panel's own setMouseConfigData frame plus a mock mouse (unsolicited reports, silent mouse, a mouse that ignores writes).

One deliberate difference from the panel: it writes wakeup << 4 | move_light but reads both fields back from the high nibble, so a save flips the move-light bit. The driver keeps that byte opaque.

Not done

Buttons and macros (same slot layout as the K-snake, commands 0x08/0x09), NJ08 lighting, wake mode, line correction. The panel has no lift-off or debounce controls.

Testing

npm run build and the full suite pass. No capture or hardware exists for any of these mice, so this is untested; the ticket reporter has an NJ07 MC and can test once it ships.

App wiring: OpenMouse-Project/openmouse#658 (draft). Catalog: OpenMouse-Project/openmouse-landing-page#35.

…panel

Requested for the NJ07 MC in Discord ticket 0156. The vendor's WebHID panel
(nacodex.yjx2012.com, "V1" device class) speaks the K-snake command family
with a different frame: output report 0xF0 with 63 body bytes, replies that
echo the command, and different header bytes. Product ids 0x2157, 0x2158,
0x2167, 0x2168, 0x2177 and 0x2178 on VID 0xA8A4 (wired) and 0xA8A5 (dongle).
0x2255 stays with the K-snake driver.

No capture exists; every byte comes from the panel's JavaScript. Covers
identity, battery, firmware, DPI stages, polling rate, sleep timer and scroll
direction. Every write reads the config block back and fails if the mouse kept
the old value. The wake/move-light byte is carried opaque because the panel
decodes it with a nibble bug. Buttons, macros, NJ08 lighting and wake mode are
left for after a hardware test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@SHIMORA-6600X

Copy link
Copy Markdown

yeah that's me

@snekxs
snekxs merged commit 3b9bfcb into OpenMouse-Project:main Oct 8, 2026
5 checks passed
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.28.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

snekxs pushed a commit to Linspen/mouse-protocol that referenced this pull request Oct 8, 2026
Resolve add/add conflicts with PR OpenMouse-Project#177 (NJ07/NJ08) so both Ajazz
families coexist:
- src/ajazz/index.ts keeps the NJ07/NJ08 codec; AK820 constants move
  to src/ajazz/ak820.ts with AK820-infixed export names.
- src/drivers/ajazz/hid.ts keeps the NJ07 client; the AK820 identity
  client moves to src/drivers/ajazz/ak820-hid.ts (+ ak820-hid.test.ts).
- registry.ts registers both drivers; vendors.ts keeps both filter sets.
- package-lock.json keeps the AGPL license field (matches main's
  package.json).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants