@openmouse/protocol 0.52.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drivers/gwolves/products.js +2 -2
- package/dist/drivers/gwolves/products.js.map +1 -1
- package/dist/drivers/gwolves/xvi-hid.js +1 -1
- package/dist/drivers/gwolves/xvi-hid.js.map +1 -1
- package/dist/drivers/mouse-types.d.ts +1 -1
- package/dist/drivers/mouse-types.d.ts.map +1 -1
- package/dist/drivers/registry.d.ts +2 -1
- package/dist/drivers/registry.d.ts.map +1 -1
- package/dist/drivers/registry.js +5 -0
- package/dist/drivers/registry.js.map +1 -1
- package/dist/drivers/roccat/hid.d.ts +78 -0
- package/dist/drivers/roccat/hid.d.ts.map +1 -0
- package/dist/drivers/roccat/hid.js +182 -0
- package/dist/drivers/roccat/hid.js.map +1 -0
- package/dist/drivers/vendors.d.ts +2 -0
- package/dist/drivers/vendors.d.ts.map +1 -1
- package/dist/drivers/vendors.js +10 -0
- package/dist/drivers/vendors.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/roccat/index.d.ts +103 -0
- package/dist/roccat/index.d.ts.map +1 -0
- package/dist/roccat/index.js +148 -0
- package/dist/roccat/index.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ROCCAT Kone Pro Air (`1e7d:2c8e` via the Stellar Wireless dongle, `1e7d:2c92`
|
|
3
|
+
* wired) and sibling Kone Pro firmware — the read side.
|
|
4
|
+
*
|
|
5
|
+
* Transport: the mouse speaks on the composite's vendor interface (usage page
|
|
6
|
+
* 0xFF00, usage 0x0001 — interface 2 of the dongle, interface 1 wired) with
|
|
7
|
+
* plain unnumbered output reports. WebHID callers send
|
|
8
|
+
* `sendReport(0, payload64)`; the mouse answers on the same interface's
|
|
9
|
+
* interrupt-IN stream. There is no feature report here — a full 0x00–0xFF
|
|
10
|
+
* GET sweep on this unit answered nothing (2026-10-14, Windows node-hid,
|
|
11
|
+
* `captures/roccat-kone-pro-air/`).
|
|
12
|
+
*
|
|
13
|
+
* Payload frame layout (device coordinates, ahead of no report id):
|
|
14
|
+
*
|
|
15
|
+
* - `0x10 0x50 <sub>` — performance class: the settings query (0x14) and the
|
|
16
|
+
* `0x18` apply tail the vendor software sends after a write;
|
|
17
|
+
* - `0x90 0x0a` — the unnamed status probe, answered `0x90 0x0a 04 00 00 — `
|
|
18
|
+
* with a body whose meaning is unresolved (see the note by
|
|
19
|
+
* `roccatIsStatusReply`).
|
|
20
|
+
*
|
|
21
|
+
* **This module decodes, it does not encode settings writes.** No setter ships
|
|
22
|
+
* until a capture shows one landing: the 2026-10-16 session sent the vendor's
|
|
23
|
+
* own settings frame by hand, got the expected echo, and the reply pages still
|
|
24
|
+
* read the previously stored stage table, while a passive listener saw the
|
|
25
|
+
* vendor software's reads and no write on any of the four interfaces. Frames
|
|
26
|
+
* being accepted is not the same as frames being applied, and a whole-block
|
|
27
|
+
* write that is not applied still costs the user their settings. The protocol
|
|
28
|
+
* bytes below are kept because they are what the captures establish; the
|
|
29
|
+
* encoders are not, because nothing establishes them.
|
|
30
|
+
*/
|
|
31
|
+
export const ROCCAT_VENDOR_ID = 0x1e7d; // ROCCAT GmbH (now Turtle Beach)
|
|
32
|
+
export const ROCCAT_KONE_PRO_AIR_WIRELESS_PID = 0x2c8e; // Stellar Wireless dongle
|
|
33
|
+
export const ROCCAT_KONE_PRO_AIR_WIRED_PID = 0x2c92; // wired generation
|
|
34
|
+
export const ROCCAT_KONE_PRO_PID = 0x2c8f; // wired Kone Pro, same Swarm family
|
|
35
|
+
export const ROCCAT_PRODUCT_NAMES = new Map([
|
|
36
|
+
[ROCCAT_KONE_PRO_AIR_WIRELESS_PID, "ROCCAT Kone Pro Air"],
|
|
37
|
+
[ROCCAT_KONE_PRO_AIR_WIRED_PID, "ROCCAT Kone Pro Air (Wired)"],
|
|
38
|
+
]);
|
|
39
|
+
export const ROCCAT_PRODUCT_IDS = [
|
|
40
|
+
ROCCAT_KONE_PRO_AIR_WIRELESS_PID,
|
|
41
|
+
ROCCAT_KONE_PRO_AIR_WIRED_PID,
|
|
42
|
+
];
|
|
43
|
+
/** Vendor collection on the dongle's interface 2 (interface 1 when wired). */
|
|
44
|
+
export const ROCCAT_CONFIG_USAGE_PAGE = 0xff00;
|
|
45
|
+
export const ROCCAT_CONFIG_USAGE = 0x0001;
|
|
46
|
+
/** Payload size of every config frame; unnumbered report id 0. */
|
|
47
|
+
export const ROCCAT_PACKET_LENGTH = 64;
|
|
48
|
+
export const ROCCAT_REPORT_ID = 0x00;
|
|
49
|
+
/** Byte 0 of a 64-byte config frame: carries no discovered meaning. */
|
|
50
|
+
export const ROCCAT_FRAME_PREFIX = 0x10;
|
|
51
|
+
export const ROCCAT_PERFORMANCE_CLASS = 0x50;
|
|
52
|
+
export const ROCCAT_STATUS_COMMAND_ID = 0x90;
|
|
53
|
+
/**
|
|
54
|
+
* Sub-commands of the performance class. `settingsGroup` is the settings
|
|
55
|
+
* query this module sends; `applyGroup` is the `10 50 18 04` tail the vendor
|
|
56
|
+
* software sends after a settings write, and appears here only because the
|
|
57
|
+
* decoder has to recognise an echo of it.
|
|
58
|
+
*/
|
|
59
|
+
export const ROCCAT_PERFORMANCE_COMMAND = {
|
|
60
|
+
settingsGroup: 0x14,
|
|
61
|
+
applyGroup: 0x18,
|
|
62
|
+
};
|
|
63
|
+
/** Unnamed status probe SignalRGB ends its setup with: `90 0a`. */
|
|
64
|
+
export const ROCCAT_STATUS_COMMAND = [
|
|
65
|
+
ROCCAT_STATUS_COMMAND_ID,
|
|
66
|
+
0x0a,
|
|
67
|
+
];
|
|
68
|
+
export const ROCCAT_POLLING_TABLE = [125, 250, 500, 1000];
|
|
69
|
+
/** Opposite of the Burst Core polling dict (125 -> 0x03 here). */
|
|
70
|
+
export const ROCCAT_HZ_TO_POLLING_CODE = new Map([
|
|
71
|
+
[1000, 0x00],
|
|
72
|
+
[500, 0x01],
|
|
73
|
+
[250, 0x02],
|
|
74
|
+
[125, 0x03],
|
|
75
|
+
]);
|
|
76
|
+
/**
|
|
77
|
+
* DPI is stored per 50 in a single byte slot, so the encodable ceiling is
|
|
78
|
+
* 255 x 50 = 12,750. The vendor software advertises higher numbers, but that
|
|
79
|
+
* encoding was never captured and does not fit this byte, so it is not
|
|
80
|
+
* claimed here.
|
|
81
|
+
*/
|
|
82
|
+
export const ROCCAT_DPI_MIN = 50;
|
|
83
|
+
export const ROCCAT_DPI_MAX = 12750;
|
|
84
|
+
export const ROCCAT_DPI_STEP = 50;
|
|
85
|
+
/** The stored table carries five stages of each axis. */
|
|
86
|
+
export const ROCCAT_DPI_STAGE_COUNT = 5;
|
|
87
|
+
/** LOD byte in the settings block: 0x06 = low, 0x07 = high. */
|
|
88
|
+
export const ROCCAT_LOD = {
|
|
89
|
+
low: 0x06,
|
|
90
|
+
high: 0x07,
|
|
91
|
+
};
|
|
92
|
+
/** The empty settings query — a 0x14 frame with no arguments. */
|
|
93
|
+
export function roccatEncodeSettingsQuery() {
|
|
94
|
+
const view = new Uint8Array(ROCCAT_PACKET_LENGTH);
|
|
95
|
+
view[0] = ROCCAT_FRAME_PREFIX;
|
|
96
|
+
view[1] = ROCCAT_PERFORMANCE_CLASS;
|
|
97
|
+
view[2] = ROCCAT_PERFORMANCE_COMMAND.settingsGroup;
|
|
98
|
+
return view;
|
|
99
|
+
}
|
|
100
|
+
/** Decodes a settings echo into its DPI table, or null when the reply is not a settings frame or carries an empty (asleep) body. */
|
|
101
|
+
export function roccatDecodeSettingsReply(reply) {
|
|
102
|
+
if (reply.length < 18
|
|
103
|
+
|| reply[0] !== ROCCAT_FRAME_PREFIX
|
|
104
|
+
|| reply[1] !== ROCCAT_PERFORMANCE_CLASS
|
|
105
|
+
|| reply[2] === undefined) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
if (reply[2] !== 0x03 && reply[2] !== ROCCAT_PERFORMANCE_COMMAND.settingsGroup
|
|
109
|
+
&& reply[2] !== ROCCAT_PERFORMANCE_COMMAND.applyGroup) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
const stageSlots = [];
|
|
113
|
+
const stageSlotsY = [];
|
|
114
|
+
for (let index = 0; index < ROCCAT_DPI_STAGE_COUNT; index += 1) {
|
|
115
|
+
stageSlots.push(reply[8 + index * 2]);
|
|
116
|
+
stageSlotsY.push(reply[9 + index * 2]);
|
|
117
|
+
}
|
|
118
|
+
// An asleep mouse echoes the frame with an empty body (all twenty slots
|
|
119
|
+
// zero). Reporting that as five stages of 0 DPI would invent a state, so an
|
|
120
|
+
// all-zero table means "no data" exactly like a missed echo does.
|
|
121
|
+
if (stageSlots.every((slot) => slot === 0) && stageSlotsY.every((slot) => slot === 0))
|
|
122
|
+
return null;
|
|
123
|
+
return {
|
|
124
|
+
dpi: {
|
|
125
|
+
stages: stageSlots.map((slot) => slot * ROCCAT_DPI_STEP),
|
|
126
|
+
stagesY: stageSlotsY.map((slot) => slot * ROCCAT_DPI_STEP),
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/** The status probe, answered `90 0a …` on the input stream. */
|
|
131
|
+
export function roccatEncodeStatus() {
|
|
132
|
+
const view = new Uint8Array(ROCCAT_PACKET_LENGTH);
|
|
133
|
+
view[0] = ROCCAT_STATUS_COMMAND[0];
|
|
134
|
+
view[1] = ROCCAT_STATUS_COMMAND[1];
|
|
135
|
+
return view;
|
|
136
|
+
}
|
|
137
|
+
/** Reply to the status probe recorded on this unit: `90 0a 04 00 00 <byte5 — `. */
|
|
138
|
+
export function roccatIsStatusReply(reply) {
|
|
139
|
+
return reply.length >= 2 && reply[0] === ROCCAT_STATUS_COMMAND[0] && reply[1] === ROCCAT_STATUS_COMMAND[1];
|
|
140
|
+
}
|
|
141
|
+
// The status echo `90 0a 04 00 00 1e 00 00 <word> 1e` was recorded on this
|
|
142
|
+
// unit, but byte 5's meaning is unresolved here: it moved 0x1e -> 0x14 across
|
|
143
|
+
// sessions while the trailing u16 increased (2720 -> 2884), so a battery
|
|
144
|
+
// percent, a signal strength and an elapsed counter all fit. The 2026-10-16
|
|
145
|
+
// capture later lined byte 5 up with the vendor software's own battery log,
|
|
146
|
+
// but that is a reading from Swarm, not from this driver, so no battery value
|
|
147
|
+
// is surfaced until a capture establishes it from the reply itself.
|
|
148
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/roccat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,iCAAiC;AAEzE,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC,CAAC,0BAA0B;AAClF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,CAAC,mBAAmB;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,CAAC,oCAAoC;AAE/E,MAAM,CAAC,MAAM,oBAAoB,GAAgC,IAAI,GAAG,CAAC;IACvE,CAAC,gCAAgC,EAAE,qBAAqB,CAAC;IACzD,CAAC,6BAA6B,EAAE,6BAA6B,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,gCAAgC;IAChC,6BAA6B;CAC9B,CAAC;AAEF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAE1C,kEAAkE;AAClE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,uEAAuE;AACvE,MAAM,CAAC,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AAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,eAAe,CAAC;YACxD,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,eAAe,CAAC;SAC3D;KACF,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,kBAAkB;IAChC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAClD,IAAI,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAE,CAAC;IACpC,IAAI,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAE,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,mBAAmB,CAAC,KAAiB;IACnD,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,qBAAqB,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAC7G,CAAC;AAED,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,oEAAoE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmouse/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "Gaming mouse protocol codecs and WebHID drivers used by OpenMouse.",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -237,6 +237,10 @@
|
|
|
237
237
|
"./hitscan": {
|
|
238
238
|
"types": "./dist/hitscan/index.d.ts",
|
|
239
239
|
"import": "./dist/hitscan/index.js"
|
|
240
|
+
},
|
|
241
|
+
"./roccat": {
|
|
242
|
+
"types": "./dist/roccat/index.d.ts",
|
|
243
|
+
"import": "./dist/roccat/index.js"
|
|
240
244
|
}
|
|
241
245
|
},
|
|
242
246
|
"scripts": {
|