@openmouse/protocol 0.49.0 → 0.51.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.
Files changed (175) hide show
  1. package/README.md +2 -0
  2. package/dist/amkette/index.d.ts +2 -0
  3. package/dist/amkette/index.d.ts.map +1 -0
  4. package/dist/amkette/index.js +2 -0
  5. package/dist/amkette/index.js.map +1 -0
  6. package/dist/amkette/xs.d.ts +63 -0
  7. package/dist/amkette/xs.d.ts.map +1 -0
  8. package/dist/amkette/xs.js +79 -0
  9. package/dist/amkette/xs.js.map +1 -0
  10. package/dist/corsair/bragi.d.ts +70 -12
  11. package/dist/corsair/bragi.d.ts.map +1 -1
  12. package/dist/corsair/bragi.js +85 -16
  13. package/dist/corsair/bragi.js.map +1 -1
  14. package/dist/drivers/amkette/xs-hid.d.ts +142 -0
  15. package/dist/drivers/amkette/xs-hid.d.ts.map +1 -0
  16. package/dist/drivers/amkette/xs-hid.js +683 -0
  17. package/dist/drivers/amkette/xs-hid.js.map +1 -0
  18. package/dist/drivers/atk/hid.d.ts.map +1 -1
  19. package/dist/drivers/atk/hid.js +2 -2
  20. package/dist/drivers/atk/hid.js.map +1 -1
  21. package/dist/drivers/atk/products.d.ts +7 -0
  22. package/dist/drivers/atk/products.d.ts.map +1 -1
  23. package/dist/drivers/atk/products.js +19 -2
  24. package/dist/drivers/atk/products.js.map +1 -1
  25. package/dist/drivers/corsair/bragi-hid.d.ts +17 -12
  26. package/dist/drivers/corsair/bragi-hid.d.ts.map +1 -1
  27. package/dist/drivers/corsair/bragi-hid.js +35 -15
  28. package/dist/drivers/corsair/bragi-hid.js.map +1 -1
  29. package/dist/drivers/gwolves/products.d.ts +5 -0
  30. package/dist/drivers/gwolves/products.d.ts.map +1 -1
  31. package/dist/drivers/gwolves/products.js +17 -10
  32. package/dist/drivers/gwolves/products.js.map +1 -1
  33. package/dist/drivers/gwolves/xvi-hid.d.ts +1 -0
  34. package/dist/drivers/gwolves/xvi-hid.d.ts.map +1 -1
  35. package/dist/drivers/gwolves/xvi-hid.js +14 -7
  36. package/dist/drivers/gwolves/xvi-hid.js.map +1 -1
  37. package/dist/drivers/hitscan/xvi-hid.d.ts +110 -0
  38. package/dist/drivers/hitscan/xvi-hid.d.ts.map +1 -0
  39. package/dist/drivers/hitscan/xvi-hid.js +803 -0
  40. package/dist/drivers/hitscan/xvi-hid.js.map +1 -0
  41. package/dist/drivers/incott/hid.d.ts +5 -0
  42. package/dist/drivers/incott/hid.d.ts.map +1 -1
  43. package/dist/drivers/incott/hid.js +18 -7
  44. package/dist/drivers/incott/hid.js.map +1 -1
  45. package/dist/drivers/lamzu/hid.d.ts +4 -0
  46. package/dist/drivers/lamzu/hid.d.ts.map +1 -1
  47. package/dist/drivers/lamzu/hid.js +41 -2
  48. package/dist/drivers/lamzu/hid.js.map +1 -1
  49. package/dist/drivers/lamzu-atlantis/hid.d.ts.map +1 -1
  50. package/dist/drivers/lamzu-atlantis/hid.js +2 -3
  51. package/dist/drivers/lamzu-atlantis/hid.js.map +1 -1
  52. package/dist/drivers/logitech/hidpp.d.ts +2 -0
  53. package/dist/drivers/logitech/hidpp.d.ts.map +1 -1
  54. package/dist/drivers/logitech/hidpp.js +28 -13
  55. package/dist/drivers/logitech/hidpp.js.map +1 -1
  56. package/dist/drivers/mchose/hid.d.ts +9 -0
  57. package/dist/drivers/mchose/hid.d.ts.map +1 -1
  58. package/dist/drivers/mchose/hid.js +36 -5
  59. package/dist/drivers/mchose/hid.js.map +1 -1
  60. package/dist/drivers/motospeed/hid.js +1 -1
  61. package/dist/drivers/motospeed/hid.js.map +1 -1
  62. package/dist/drivers/mouse-types.d.ts +17 -1
  63. package/dist/drivers/mouse-types.d.ts.map +1 -1
  64. package/dist/drivers/ninjutso/hid.d.ts +1 -0
  65. package/dist/drivers/ninjutso/hid.d.ts.map +1 -1
  66. package/dist/drivers/ninjutso/hid.js +18 -11
  67. package/dist/drivers/ninjutso/hid.js.map +1 -1
  68. package/dist/drivers/pulsar/pulsar-hid.js +1 -1
  69. package/dist/drivers/pulsar/pulsar-hid.js.map +1 -1
  70. package/dist/drivers/razer/hid.d.ts +0 -1
  71. package/dist/drivers/razer/hid.d.ts.map +1 -1
  72. package/dist/drivers/razer/hid.js +14 -9
  73. package/dist/drivers/razer/hid.js.map +1 -1
  74. package/dist/drivers/redragon/hid.d.ts +44 -63
  75. package/dist/drivers/redragon/hid.d.ts.map +1 -1
  76. package/dist/drivers/redragon/hid.js +207 -270
  77. package/dist/drivers/redragon/hid.js.map +1 -1
  78. package/dist/drivers/registry.d.ts +2 -1
  79. package/dist/drivers/registry.d.ts.map +1 -1
  80. package/dist/drivers/registry.js +12 -1
  81. package/dist/drivers/registry.js.map +1 -1
  82. package/dist/drivers/ryunix/kyu-pro-mx1-hid.d.ts.map +1 -1
  83. package/dist/drivers/ryunix/kyu-pro-mx1-hid.js +4 -1
  84. package/dist/drivers/ryunix/kyu-pro-mx1-hid.js.map +1 -1
  85. package/dist/drivers/scyrox/hid.d.ts +5 -0
  86. package/dist/drivers/scyrox/hid.d.ts.map +1 -1
  87. package/dist/drivers/scyrox/hid.js +5 -0
  88. package/dist/drivers/scyrox/hid.js.map +1 -1
  89. package/dist/drivers/vendors.d.ts +8 -3
  90. package/dist/drivers/vendors.d.ts.map +1 -1
  91. package/dist/drivers/vendors.js +41 -13
  92. package/dist/drivers/vendors.js.map +1 -1
  93. package/dist/gearhub/index.d.ts +8 -0
  94. package/dist/gearhub/index.d.ts.map +1 -1
  95. package/dist/gearhub/index.js +18 -0
  96. package/dist/gearhub/index.js.map +1 -1
  97. package/dist/hitscan/index.d.ts +2 -0
  98. package/dist/hitscan/index.d.ts.map +1 -1
  99. package/dist/hitscan/index.js +2 -0
  100. package/dist/hitscan/index.js.map +1 -1
  101. package/dist/hitscan/xvi-inputs.d.ts +81 -0
  102. package/dist/hitscan/xvi-inputs.d.ts.map +1 -0
  103. package/dist/hitscan/xvi-inputs.js +393 -0
  104. package/dist/hitscan/xvi-inputs.js.map +1 -0
  105. package/dist/hitscan/xvi.d.ts +278 -0
  106. package/dist/hitscan/xvi.d.ts.map +1 -0
  107. package/dist/hitscan/xvi.js +773 -0
  108. package/dist/hitscan/xvi.js.map +1 -0
  109. package/dist/incott/index.d.ts +33 -8
  110. package/dist/incott/index.d.ts.map +1 -1
  111. package/dist/incott/index.js +44 -11
  112. package/dist/incott/index.js.map +1 -1
  113. package/dist/index.d.ts +1 -0
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +1 -0
  116. package/dist/index.js.map +1 -1
  117. package/dist/keychron/index.d.ts.map +1 -1
  118. package/dist/keychron/index.js +4 -0
  119. package/dist/keychron/index.js.map +1 -1
  120. package/dist/lamzu/atlantis.d.ts +18 -9
  121. package/dist/lamzu/atlantis.d.ts.map +1 -1
  122. package/dist/lamzu/atlantis.js +21 -6
  123. package/dist/lamzu/atlantis.js.map +1 -1
  124. package/dist/lamzu/index.d.ts +8 -5
  125. package/dist/lamzu/index.d.ts.map +1 -1
  126. package/dist/lamzu/index.js +10 -5
  127. package/dist/lamzu/index.js.map +1 -1
  128. package/dist/mchose/index.d.ts +14 -0
  129. package/dist/mchose/index.d.ts.map +1 -1
  130. package/dist/mchose/index.js +25 -2
  131. package/dist/mchose/index.js.map +1 -1
  132. package/dist/ninjutso/index.d.ts.map +1 -1
  133. package/dist/ninjutso/index.js +5 -2
  134. package/dist/ninjutso/index.js.map +1 -1
  135. package/dist/razer/codec.d.ts +3 -2
  136. package/dist/razer/codec.d.ts.map +1 -1
  137. package/dist/razer/codec.js +5 -4
  138. package/dist/razer/codec.js.map +1 -1
  139. package/dist/redragon/deprecated.d.ts +24 -0
  140. package/dist/redragon/deprecated.d.ts.map +1 -0
  141. package/dist/redragon/deprecated.js +54 -0
  142. package/dist/redragon/deprecated.js.map +1 -0
  143. package/dist/redragon/holtek.d.ts +127 -0
  144. package/dist/redragon/holtek.d.ts.map +1 -0
  145. package/dist/redragon/holtek.js +232 -0
  146. package/dist/redragon/holtek.js.map +1 -0
  147. package/dist/redragon/index.d.ts +9 -203
  148. package/dist/redragon/index.d.ts.map +1 -1
  149. package/dist/redragon/index.js +11 -430
  150. package/dist/redragon/index.js.map +1 -1
  151. package/dist/redragon/m612.d.ts +82 -0
  152. package/dist/redragon/m612.d.ts.map +1 -0
  153. package/dist/redragon/m612.js +166 -0
  154. package/dist/redragon/m612.js.map +1 -0
  155. package/dist/redragon/m724.d.ts +47 -0
  156. package/dist/redragon/m724.d.ts.map +1 -0
  157. package/dist/redragon/m724.js +107 -0
  158. package/dist/redragon/m724.js.map +1 -0
  159. package/dist/ryunix/index.d.ts +1 -0
  160. package/dist/ryunix/index.d.ts.map +1 -1
  161. package/dist/ryunix/index.js +1 -0
  162. package/dist/ryunix/index.js.map +1 -1
  163. package/dist/ryunix/kyu-pro-mx1.d.ts +10 -1
  164. package/dist/ryunix/kyu-pro-mx1.d.ts.map +1 -1
  165. package/dist/ryunix/kyu-pro-mx1.js +10 -12
  166. package/dist/ryunix/kyu-pro-mx1.js.map +1 -1
  167. package/dist/ryunix/protocol.d.ts +204 -0
  168. package/dist/ryunix/protocol.d.ts.map +1 -0
  169. package/dist/ryunix/protocol.js +366 -0
  170. package/dist/ryunix/protocol.js.map +1 -0
  171. package/dist/scyrox/index.d.ts +5 -0
  172. package/dist/scyrox/index.d.ts.map +1 -1
  173. package/dist/scyrox/index.js +37 -1
  174. package/dist/scyrox/index.js.map +1 -1
  175. package/package.json +6 -1
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Configuration protocol of the 0x04F3:0x026E/0x026F OEM mouse firmware, as
3
+ * used by Amkette's XS Flow series and the Ryunix Kyu Pro MX1. Reverse-engineered
4
+ * from Amkette's public WebHID configurator
5
+ * (https://support.amkette.com/webapp/xs_flow_2_speed/); nothing here has been
6
+ * seen in a vendor binary.
7
+ *
8
+ * Transport: the mouse's control collection (usage page 0x0A) carries
9
+ * - input report 0x04: telemetry (see `kyu-pro-mx1.ts`);
10
+ * - feature report 0x05: status read, which makes the mouse emit report 0x04;
11
+ * - feature report 0x06: 31-byte command write; reading it back returns the
12
+ * acknowledgement, whose byte 1 is 1 when the command was accepted.
13
+ *
14
+ * Command frame (31 bytes): `[command, sequence, sub, checksum, ...payload]`.
15
+ * The checksum is `(6 + sum of the other 30 bytes) & 0xFF` and sits at offset
16
+ * 3. The vendor pads payloads with 0xFF, except polling rate and reset (0x00).
17
+ * The mouse never reports DPI values, lift-off distance, sleep time or button
18
+ * maps back, so those are write-only; only the active DPI stage, polling rate,
19
+ * battery and lighting mode arrive in telemetry.
20
+ *
21
+ * Only the Amkette XS driver (`src/drivers/amkette/xs-hid.ts`) sends these
22
+ * commands, and they have only been checked on an Amkette mouse. The Ryunix Kyu
23
+ * Pro MX1 driver reads telemetry only; do not wire these writes into it before
24
+ * they have been checked on that mouse.
25
+ */
26
+ export declare const RYUNIX_COMMAND_REPORT_ID = 6;
27
+ export declare const RYUNIX_COMMAND_FRAME_LENGTH = 31;
28
+ export declare const RYUNIX_COMMAND: {
29
+ readonly buttons: 1;
30
+ readonly dpi: 2;
31
+ readonly dpiColors: 3;
32
+ readonly pollingRate: 4;
33
+ readonly liftOffDistance: 5;
34
+ readonly lighting: 6;
35
+ readonly power: 7;
36
+ readonly sensorOptions: 8;
37
+ readonly macroWrite: 16;
38
+ readonly macroErase: 17;
39
+ readonly reset: 15;
40
+ };
41
+ export declare const RYUNIX_DPI_SLOTS = 8;
42
+ export declare const RYUNIX_DPI_MAX_STAGES = 7;
43
+ export declare const RYUNIX_DPI_MIN = 200;
44
+ export declare const RYUNIX_DPI_STEP = 100;
45
+ /** Sequence counter the vendor app increments per command, wrapping at 256. */
46
+ export declare function ryunixNextSequence(current: number): number;
47
+ /**
48
+ * Build one command frame. `payload` is placed after the checksum and padded
49
+ * with `pad` to the fixed frame length.
50
+ */
51
+ export declare function ryunixFrame(command: number, sequence: number, sub: number, payload: readonly number[], pad?: number): Uint8Array;
52
+ /** True when the acknowledgement read from report 0x06 reports success. */
53
+ export declare function ryunixAckOk(ack: Uint8Array): boolean;
54
+ /** Polling-rate codes the mouse accepts and reports. */
55
+ export declare const RYUNIX_POLLING_CODES: ReadonlyArray<readonly [code: number, hz: number]>;
56
+ export declare function ryunixPollingHz(code: number): number | null;
57
+ /**
58
+ * Rates a mouse offers, from the "maximum report rate" byte of its telemetry
59
+ * (offset 7). 8/4/2/1 mean the mouse reaches 8000/4000/2000/1000 Hz; 0x31
60
+ * limits it to 250 Hz.
61
+ */
62
+ export declare function ryunixSupportedPollingRates(maxRateCode: number | null): number[];
63
+ export declare function ryunixSetPollingRateFrame(sequence: number, hz: number): Uint8Array;
64
+ /** Lift-off distance in millimetres; the vendor app offers 1 and 2. */
65
+ export declare const RYUNIX_LIFT_OFF_MM: readonly [1, 2];
66
+ export declare function ryunixSetLiftOffFrame(sequence: number, millimetres: number): Uint8Array;
67
+ export interface RyunixSensor {
68
+ name: string;
69
+ maxDpi: number;
70
+ /** DPI resolution of the wire value: 50 or 100 counts per step. */
71
+ step: number;
72
+ /** The vendor app's default stage table for this sensor (eight slots). */
73
+ defaultStages: readonly number[];
74
+ }
75
+ /** Sensor types the telemetry reports (offset 8), with the vendor's DPI limits. */
76
+ export declare const RYUNIX_SENSORS: ReadonlyMap<number, RyunixSensor>;
77
+ /** The vendor app assumes the 3220 until the mouse reports its sensor. */
78
+ export declare const RYUNIX_DEFAULT_SENSOR_TYPE = 32;
79
+ export declare function ryunixSensor(sensorType: number | null): RyunixSensor;
80
+ export interface RyunixDpiTable {
81
+ /** DPI of each enabled stage, lowest slot first; 1 to 7 entries. */
82
+ stages: readonly number[];
83
+ /** Zero-based active stage. */
84
+ activeStage: number;
85
+ }
86
+ /**
87
+ * The vendor app's default table for a sensor, first `count` stages. Its UI
88
+ * shows seven stages with 1600 DPI active on the XS Flow 2 Speed.
89
+ */
90
+ export declare function ryunixDefaultDpiStages(sensor: RyunixSensor, count?: number): number[];
91
+ export declare function ryunixClampDpi(dpi: number, sensor: RyunixSensor): number;
92
+ /** DPI table frame for one axis; the vendor app writes X, then Y with the same values. */
93
+ export declare function ryunixSetDpiFrame(sequence: number, table: RyunixDpiTable, sensor: RyunixSensor, axis?: "x" | "y"): Uint8Array;
94
+ /** Stage indicator colours the vendor app shows by default (the eighth is unused). */
95
+ export declare const RYUNIX_DEFAULT_DPI_COLORS: readonly string[];
96
+ export declare function ryunixParseColor(color: string): [number, number, number];
97
+ /** Per-stage DPI indicator colours (eight RGB triples). */
98
+ export declare function ryunixSetDpiColorsFrame(sequence: number, colors: readonly string[]): Uint8Array;
99
+ export interface RyunixLightingEffect {
100
+ code: number;
101
+ name: string;
102
+ brightness: boolean;
103
+ speed: boolean;
104
+ direction: boolean;
105
+ }
106
+ /** Effects the vendor app can address; which a model offers is `RYUNIX_LIGHTING_SCHEMES`. */
107
+ export declare const RYUNIX_LIGHTING_EFFECTS: ReadonlyMap<number, RyunixLightingEffect>;
108
+ /** Effect codes per model scheme in the vendor app; the XS Flow 2 Speed uses scheme 1. */
109
+ export declare const RYUNIX_LIGHTING_SCHEMES: Readonly<Record<number, readonly number[]>>;
110
+ export declare const RYUNIX_BRIGHTNESS_LEVELS: readonly [1, 2, 3, 4];
111
+ export declare const RYUNIX_SPEED_LEVELS: readonly [1, 2, 3];
112
+ export interface RyunixLightingSetting {
113
+ effect: number;
114
+ /** 1-4, used by effects with a brightness control. */
115
+ brightness?: number;
116
+ /** 1-3, used by effects with a speed control. */
117
+ speed?: number;
118
+ direction?: number;
119
+ }
120
+ export declare function ryunixSetLightingFrame(sequence: number, setting: RyunixLightingSetting): Uint8Array;
121
+ export declare const RYUNIX_SLEEP_MIN_MINUTES = 1;
122
+ export declare const RYUNIX_SLEEP_MAX_MINUTES = 15;
123
+ export interface RyunixPowerSetting {
124
+ sleepMinutes: number;
125
+ wakeOnMove: boolean;
126
+ lightOnMove: boolean;
127
+ }
128
+ export declare function ryunixSetPowerFrame(sequence: number, setting: RyunixPowerSetting): Uint8Array;
129
+ export interface RyunixSensorOptions {
130
+ angleSnapping: boolean;
131
+ motionSync: boolean;
132
+ rippleControl: boolean;
133
+ }
134
+ export declare function ryunixSetSensorOptionsFrame(sequence: number, options: RyunixSensorOptions): Uint8Array;
135
+ /** Restore factory settings. Not used by the driver; documented for completeness. */
136
+ export declare function ryunixResetFrame(sequence: number): Uint8Array;
137
+ /** A button action as the mouse stores it: three bytes `[kind, a, b]`. */
138
+ export type RyunixButtonCode = readonly [number, number, number];
139
+ /** Actions the vendor app offers, by display name. Keyboard shortcuts are `[0x70, modifier, HID key]`. */
140
+ export declare const RYUNIX_BUTTON_ACTIONS: ReadonlyMap<string, RyunixButtonCode>;
141
+ export declare function ryunixButtonActionName(code: RyunixButtonCode): string | null;
142
+ /**
143
+ * Button positions in the order the firmware stores them (the vendor app sends
144
+ * its buttons as 0,1,2,6,5,3,4,7,8, which is this order). Names follow the
145
+ * physical layout in Amkette's XS Flow 2 Speed configurator: its buttons 4 and
146
+ * 5 are the two small buttons under the wheel (default "show desktop" and "DPI
147
+ * cycle"), 6 and 7 the thumb pair, 8 and 9 the wheel tilt. Its button 10, the
148
+ * bottom mode switch, is left out so the 2.4 GHz/Bluetooth/USB switch cannot be
149
+ * remapped away.
150
+ */
151
+ export declare const RYUNIX_BUTTON_SLOTS: readonly [{
152
+ readonly id: "Left";
153
+ readonly name: "Left button";
154
+ readonly factory: "Left click";
155
+ }, {
156
+ readonly id: "Right";
157
+ readonly name: "Right button";
158
+ readonly factory: "Right click";
159
+ }, {
160
+ readonly id: "Middle";
161
+ readonly name: "Wheel button";
162
+ readonly factory: "Middle click";
163
+ }, {
164
+ readonly id: "Back";
165
+ readonly name: "Back button";
166
+ readonly factory: "Back";
167
+ }, {
168
+ readonly id: "Forward";
169
+ readonly name: "Forward button";
170
+ readonly factory: "Forward";
171
+ }, {
172
+ readonly id: "Upper";
173
+ readonly name: "Upper centre button";
174
+ readonly factory: "Show desktop";
175
+ }, {
176
+ readonly id: "Dpi";
177
+ readonly name: "DPI button";
178
+ readonly factory: "DPI cycle";
179
+ }, {
180
+ readonly id: "TiltLeft";
181
+ readonly name: "Wheel tilt left";
182
+ readonly factory: "Tilt left";
183
+ }, {
184
+ readonly id: "TiltRight";
185
+ readonly name: "Wheel tilt right";
186
+ readonly factory: "Tilt right";
187
+ }];
188
+ export declare const RYUNIX_BUTTON_POSITIONS = 10;
189
+ /**
190
+ * What each of the ten positions holds in the vendor app's default layout, in
191
+ * firmware order. Position 9 is the bottom mode switch, which is not offered for
192
+ * remapping but is part of every button write. The vendor app writes all ten
193
+ * from this layout, so a write that has to fill positions it was not asked to
194
+ * change uses these rather than 0xFF, whose meaning on this firmware is unknown.
195
+ */
196
+ export declare const RYUNIX_BUTTON_FACTORY_CODES: readonly RyunixButtonCode[];
197
+ /**
198
+ * Button table frames for the ten-position layout the XS Flow configurator
199
+ * uses: positions 0-8 in a first frame (sub 0x02) and position 9 in a second
200
+ * (sub 0x12). `positions[i]` is `null` for 0xFF 0xFF 0xFF, which the vendor app
201
+ * writes for a button it has no assignment for.
202
+ */
203
+ export declare function ryunixSetButtonsFrames(sequences: readonly [first: number, second: number], positions: ReadonlyArray<RyunixButtonCode | null>): [Uint8Array, Uint8Array];
204
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/ryunix/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,eAAO,MAAM,wBAAwB,IAAO,CAAC;AAC7C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,eAAO,MAAM,cAAc;;;;;;;;;;;;CAYjB,CAAC;AAMX,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUtB,CAAC;AAEX,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,gBAAgB,EAWlE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACnD,SAAS,EAAE,aAAa,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAChD,CAAC,UAAU,EAAE,UAAU,CAAC,CAS1B"}
@@ -0,0 +1,366 @@
1
+ /**
2
+ * Configuration protocol of the 0x04F3:0x026E/0x026F OEM mouse firmware, as
3
+ * used by Amkette's XS Flow series and the Ryunix Kyu Pro MX1. Reverse-engineered
4
+ * from Amkette's public WebHID configurator
5
+ * (https://support.amkette.com/webapp/xs_flow_2_speed/); nothing here has been
6
+ * seen in a vendor binary.
7
+ *
8
+ * Transport: the mouse's control collection (usage page 0x0A) carries
9
+ * - input report 0x04: telemetry (see `kyu-pro-mx1.ts`);
10
+ * - feature report 0x05: status read, which makes the mouse emit report 0x04;
11
+ * - feature report 0x06: 31-byte command write; reading it back returns the
12
+ * acknowledgement, whose byte 1 is 1 when the command was accepted.
13
+ *
14
+ * Command frame (31 bytes): `[command, sequence, sub, checksum, ...payload]`.
15
+ * The checksum is `(6 + sum of the other 30 bytes) & 0xFF` and sits at offset
16
+ * 3. The vendor pads payloads with 0xFF, except polling rate and reset (0x00).
17
+ * The mouse never reports DPI values, lift-off distance, sleep time or button
18
+ * maps back, so those are write-only; only the active DPI stage, polling rate,
19
+ * battery and lighting mode arrive in telemetry.
20
+ *
21
+ * Only the Amkette XS driver (`src/drivers/amkette/xs-hid.ts`) sends these
22
+ * commands, and they have only been checked on an Amkette mouse. The Ryunix Kyu
23
+ * Pro MX1 driver reads telemetry only; do not wire these writes into it before
24
+ * they have been checked on that mouse.
25
+ */
26
+ export const RYUNIX_COMMAND_REPORT_ID = 0x06;
27
+ export const RYUNIX_COMMAND_FRAME_LENGTH = 31;
28
+ export const RYUNIX_COMMAND = {
29
+ buttons: 0x01,
30
+ dpi: 0x02,
31
+ dpiColors: 0x03,
32
+ pollingRate: 0x04,
33
+ liftOffDistance: 0x05,
34
+ lighting: 0x06,
35
+ power: 0x07,
36
+ sensorOptions: 0x08,
37
+ macroWrite: 0x10,
38
+ macroErase: 0x11,
39
+ reset: 0x0f,
40
+ };
41
+ /** Sub-command of the DPI table write: X axis, then the Y axis copy. */
42
+ const DPI_SUB_X = 0x02;
43
+ const DPI_SUB_Y = 0x12;
44
+ export const RYUNIX_DPI_SLOTS = 8;
45
+ export const RYUNIX_DPI_MAX_STAGES = 7;
46
+ export const RYUNIX_DPI_MIN = 200;
47
+ export const RYUNIX_DPI_STEP = 100;
48
+ /** Sequence counter the vendor app increments per command, wrapping at 256. */
49
+ export function ryunixNextSequence(current) {
50
+ return (current + 1) & 0xff;
51
+ }
52
+ /**
53
+ * Build one command frame. `payload` is placed after the checksum and padded
54
+ * with `pad` to the fixed frame length.
55
+ */
56
+ export function ryunixFrame(command, sequence, sub, payload, pad = 0xff) {
57
+ const bodyLength = RYUNIX_COMMAND_FRAME_LENGTH - 1;
58
+ if (payload.length > bodyLength - 3) {
59
+ throw new RangeError(`Ryunix payload is ${payload.length} bytes; at most ${bodyLength - 3} fit.`);
60
+ }
61
+ const body = new Uint8Array(bodyLength).fill(pad);
62
+ body[0] = command;
63
+ body[1] = sequence & 0xff;
64
+ body[2] = sub;
65
+ payload.forEach((byte, index) => {
66
+ if (!Number.isInteger(byte) || byte < 0 || byte > 0xff) {
67
+ throw new RangeError(`Ryunix payload byte ${index} (${byte}) is not a byte.`);
68
+ }
69
+ body[3 + index] = byte;
70
+ });
71
+ let checksum = 6;
72
+ for (const byte of body)
73
+ checksum += byte;
74
+ const frame = new Uint8Array(RYUNIX_COMMAND_FRAME_LENGTH);
75
+ frame.set(body.subarray(0, 3), 0);
76
+ frame[3] = checksum & 0xff;
77
+ frame.set(body.subarray(3), 4);
78
+ return frame;
79
+ }
80
+ /** True when the acknowledgement read from report 0x06 reports success. */
81
+ export function ryunixAckOk(ack) {
82
+ return ack.length > 1 && ack[1] === 1;
83
+ }
84
+ /** Polling-rate codes the mouse accepts and reports. */
85
+ export const RYUNIX_POLLING_CODES = [
86
+ [0x08, 125],
87
+ [0x04, 250],
88
+ [0x02, 500],
89
+ [0x01, 1000],
90
+ [0x11, 2000],
91
+ [0x12, 4000],
92
+ [0x14, 8000],
93
+ ];
94
+ export function ryunixPollingHz(code) {
95
+ return RYUNIX_POLLING_CODES.find(([value]) => value === code)?.[1] ?? null;
96
+ }
97
+ /**
98
+ * Rates a mouse offers, from the "maximum report rate" byte of its telemetry
99
+ * (offset 7). 8/4/2/1 mean the mouse reaches 8000/4000/2000/1000 Hz; 0x31
100
+ * limits it to 250 Hz.
101
+ */
102
+ export function ryunixSupportedPollingRates(maxRateCode) {
103
+ const base = [125, 250, 500, 1000];
104
+ switch (maxRateCode) {
105
+ case 8: return [...base, 2000, 4000, 8000];
106
+ case 4: return [...base, 2000, 4000];
107
+ case 2: return [...base, 2000];
108
+ case 0x31: return [125, 250];
109
+ default: return base;
110
+ }
111
+ }
112
+ export function ryunixSetPollingRateFrame(sequence, hz) {
113
+ const entry = RYUNIX_POLLING_CODES.find(([, rate]) => rate === hz);
114
+ if (!entry)
115
+ throw new RangeError(`Unsupported polling rate ${hz} Hz.`);
116
+ return ryunixFrame(RYUNIX_COMMAND.pollingRate, sequence, 1, [entry[0]], 0x00);
117
+ }
118
+ /** Lift-off distance in millimetres; the vendor app offers 1 and 2. */
119
+ export const RYUNIX_LIFT_OFF_MM = [1, 2];
120
+ export function ryunixSetLiftOffFrame(sequence, millimetres) {
121
+ if (!RYUNIX_LIFT_OFF_MM.includes(millimetres)) {
122
+ throw new RangeError(`Unsupported lift-off distance ${millimetres} mm.`);
123
+ }
124
+ return ryunixFrame(RYUNIX_COMMAND.liftOffDistance, sequence, 1, [millimetres]);
125
+ }
126
+ /** Sensor types the telemetry reports (offset 8), with the vendor's DPI limits. */
127
+ export const RYUNIX_SENSORS = new Map([
128
+ [0x11, { name: "3311", maxDpi: 12000, step: 100, defaultStages: [400, 800, 1600, 2400, 3200, 6400, 12000, 12000] }],
129
+ [0x95, { name: "3395", maxDpi: 26000, step: 50, defaultStages: [400, 800, 1600, 3200, 6400, 26000, 26000, 26000] }],
130
+ [0x50, { name: "3950", maxDpi: 30000, step: 50, defaultStages: [400, 800, 1600, 3200, 6400, 30000, 30000, 30000] }],
131
+ [0x20, { name: "3220", maxDpi: 8000, step: 100, defaultStages: [400, 800, 1600, 2400, 3200, 6400, 8000, 8000] }],
132
+ [0x12, { name: "3212", maxDpi: 4800, step: 100, defaultStages: [400, 800, 1200, 1600, 2400, 3200, 4800, 4800] }],
133
+ [0x09, { name: "3809", maxDpi: 6000, step: 100, defaultStages: [400, 800, 1600, 2400, 3200, 4800, 6000, 6000] }],
134
+ [0x03, { name: "S203", maxDpi: 6400, step: 100, defaultStages: [400, 800, 1200, 1600, 2400, 3200, 6400, 6400] }],
135
+ [0x06, { name: "S205", maxDpi: 12800, step: 100, defaultStages: [400, 800, 1600, 2400, 3200, 6400, 12800, 12800] }],
136
+ [0x70, { name: "OM70", maxDpi: 30000, step: 100, defaultStages: [400, 800, 1600, 3200, 6400, 30000, 30000, 30000] }],
137
+ ]);
138
+ /** The vendor app assumes the 3220 until the mouse reports its sensor. */
139
+ export const RYUNIX_DEFAULT_SENSOR_TYPE = 0x20;
140
+ export function ryunixSensor(sensorType) {
141
+ return RYUNIX_SENSORS.get(sensorType ?? RYUNIX_DEFAULT_SENSOR_TYPE)
142
+ ?? RYUNIX_SENSORS.get(RYUNIX_DEFAULT_SENSOR_TYPE);
143
+ }
144
+ /**
145
+ * The vendor app's default table for a sensor, first `count` stages. Its UI
146
+ * shows seven stages with 1600 DPI active on the XS Flow 2 Speed.
147
+ */
148
+ export function ryunixDefaultDpiStages(sensor, count = RYUNIX_DPI_MAX_STAGES) {
149
+ return sensor.defaultStages.slice(0, count);
150
+ }
151
+ export function ryunixClampDpi(dpi, sensor) {
152
+ const stepped = Math.round(dpi / RYUNIX_DPI_STEP) * RYUNIX_DPI_STEP;
153
+ return Math.min(sensor.maxDpi, Math.max(RYUNIX_DPI_MIN, stepped));
154
+ }
155
+ function dpiWire(dpi, sensor) {
156
+ return Math.floor(dpi / sensor.step) - 1;
157
+ }
158
+ /** DPI table frame for one axis; the vendor app writes X, then Y with the same values. */
159
+ export function ryunixSetDpiFrame(sequence, table, sensor, axis = "x") {
160
+ const count = table.stages.length;
161
+ if (count < 1 || count > RYUNIX_DPI_MAX_STAGES) {
162
+ throw new RangeError(`A DPI table needs 1 to ${RYUNIX_DPI_MAX_STAGES} stages, not ${count}.`);
163
+ }
164
+ if (!Number.isInteger(table.activeStage) || table.activeStage < 0 || table.activeStage >= count) {
165
+ throw new RangeError(`Active DPI stage ${table.activeStage} is outside 0-${count - 1}.`);
166
+ }
167
+ const payload = [table.activeStage, (1 << count) - 1];
168
+ for (let slot = 0; slot < RYUNIX_DPI_SLOTS; slot++) {
169
+ if (slot >= count) {
170
+ // The vendor app encodes an unused slot as DPI 0, which wraps to 0xFFFF.
171
+ payload.push(0xff, 0xff);
172
+ continue;
173
+ }
174
+ const dpi = table.stages[slot];
175
+ if (dpi < RYUNIX_DPI_MIN || dpi > sensor.maxDpi || dpi % RYUNIX_DPI_STEP !== 0) {
176
+ throw new RangeError(`DPI ${dpi} is not a multiple of ${RYUNIX_DPI_STEP} within ${RYUNIX_DPI_MIN}-${sensor.maxDpi}.`);
177
+ }
178
+ const wire = dpiWire(dpi, sensor);
179
+ payload.push(wire & 0xff, (wire >> 8) & 0xff);
180
+ }
181
+ return ryunixFrame(RYUNIX_COMMAND.dpi, sequence, axis === "x" ? DPI_SUB_X : DPI_SUB_Y, payload);
182
+ }
183
+ /** Stage indicator colours the vendor app shows by default (the eighth is unused). */
184
+ export const RYUNIX_DEFAULT_DPI_COLORS = [
185
+ "#ff0000", "#00ff00", "#0000ff", "#ffff00", "#00ffff", "#ff00ff", "#ffffff", "#ffffff",
186
+ ];
187
+ export function ryunixParseColor(color) {
188
+ const match = /^#([0-9a-f]{6})$/i.exec(color);
189
+ if (!match)
190
+ throw new RangeError(`"${color}" is not a #rrggbb colour.`);
191
+ const value = parseInt(match[1], 16);
192
+ return [(value >> 16) & 0xff, (value >> 8) & 0xff, value & 0xff];
193
+ }
194
+ /** Per-stage DPI indicator colours (eight RGB triples). */
195
+ export function ryunixSetDpiColorsFrame(sequence, colors) {
196
+ const payload = [];
197
+ for (let slot = 0; slot < RYUNIX_DPI_SLOTS; slot++) {
198
+ payload.push(...ryunixParseColor(colors[slot] ?? RYUNIX_DEFAULT_DPI_COLORS[slot]));
199
+ }
200
+ return ryunixFrame(RYUNIX_COMMAND.dpiColors, sequence, 1, payload);
201
+ }
202
+ /** Effects the vendor app can address; which a model offers is `RYUNIX_LIGHTING_SCHEMES`. */
203
+ export const RYUNIX_LIGHTING_EFFECTS = new Map([
204
+ [0, { code: 0, name: "Off", brightness: false, speed: false, direction: false }],
205
+ [1, { code: 1, name: "Rainbow flow", brightness: false, speed: true, direction: true }],
206
+ [2, { code: 2, name: "Breathe", brightness: false, speed: true, direction: false }],
207
+ [3, { code: 3, name: "Steady", brightness: true, speed: false, direction: false }],
208
+ [4, { code: 4, name: "Neon", brightness: false, speed: true, direction: false }],
209
+ [5, { code: 5, name: "Marquee", brightness: false, speed: true, direction: false }],
210
+ [6, { code: 6, name: "Rainbow steady", brightness: true, speed: false, direction: false }],
211
+ [7, { code: 7, name: "Wave", brightness: false, speed: true, direction: false }],
212
+ ]);
213
+ /** Effect codes per model scheme in the vendor app; the XS Flow 2 Speed uses scheme 1. */
214
+ export const RYUNIX_LIGHTING_SCHEMES = {
215
+ 1: [3, 2, 0],
216
+ 2: [3, 2, 4, 0],
217
+ 3: [1, 2, 3, 4, 5, 6, 7, 0],
218
+ 4: [],
219
+ };
220
+ export const RYUNIX_BRIGHTNESS_LEVELS = [1, 2, 3, 4];
221
+ export const RYUNIX_SPEED_LEVELS = [1, 2, 3];
222
+ export function ryunixSetLightingFrame(sequence, setting) {
223
+ const effect = RYUNIX_LIGHTING_EFFECTS.get(setting.effect);
224
+ if (!effect)
225
+ throw new RangeError(`Unknown lighting effect ${setting.effect}.`);
226
+ const brightness = effect.brightness
227
+ ? Math.min(Math.max(setting.brightness ?? 4, 1), 4) << 4
228
+ : 0;
229
+ const speed = effect.speed ? Math.min(Math.max(setting.speed ?? 3, 1), 3) : 0;
230
+ return ryunixFrame(RYUNIX_COMMAND.lighting, sequence, 1, [
231
+ 0xff,
232
+ effect.code,
233
+ brightness | speed,
234
+ setting.direction ?? 0,
235
+ ]);
236
+ }
237
+ export const RYUNIX_SLEEP_MIN_MINUTES = 1;
238
+ export const RYUNIX_SLEEP_MAX_MINUTES = 15;
239
+ export function ryunixSetPowerFrame(sequence, setting) {
240
+ if (!Number.isInteger(setting.sleepMinutes)
241
+ || setting.sleepMinutes < RYUNIX_SLEEP_MIN_MINUTES
242
+ || setting.sleepMinutes > RYUNIX_SLEEP_MAX_MINUTES) {
243
+ throw new RangeError(`Sleep time must be ${RYUNIX_SLEEP_MIN_MINUTES}-${RYUNIX_SLEEP_MAX_MINUTES} minutes.`);
244
+ }
245
+ return ryunixFrame(RYUNIX_COMMAND.power, sequence, 1, [
246
+ setting.sleepMinutes,
247
+ setting.wakeOnMove ? 1 : 0,
248
+ setting.lightOnMove ? 1 : 0,
249
+ ]);
250
+ }
251
+ export function ryunixSetSensorOptionsFrame(sequence, options) {
252
+ return ryunixFrame(RYUNIX_COMMAND.sensorOptions, sequence, 1, [
253
+ options.angleSnapping ? 1 : 0,
254
+ options.motionSync ? 1 : 0,
255
+ options.rippleControl ? 1 : 0,
256
+ ]);
257
+ }
258
+ /** Restore factory settings. Not used by the driver; documented for completeness. */
259
+ export function ryunixResetFrame(sequence) {
260
+ return ryunixFrame(RYUNIX_COMMAND.reset, sequence, 1, [0xff], 0x00);
261
+ }
262
+ /** Actions the vendor app offers, by display name. Keyboard shortcuts are `[0x70, modifier, HID key]`. */
263
+ export const RYUNIX_BUTTON_ACTIONS = new Map([
264
+ ["Left click", [0x10, 0x01, 0x00]],
265
+ ["Right click", [0x10, 0x02, 0x00]],
266
+ ["Middle click", [0x10, 0x04, 0x00]],
267
+ ["Back", [0x10, 0x08, 0x00]],
268
+ ["Forward", [0x10, 0x10, 0x00]],
269
+ ["Scroll up", [0x10, 0x20, 0x00]],
270
+ ["Scroll down", [0x10, 0x40, 0x00]],
271
+ ["Fire key", [0x30, 0x32, 0x00]],
272
+ ["Triple fire", [0x30, 0x32, 0x03]],
273
+ ["DPI cycle", [0x40, 0x01, 0x00]],
274
+ ["DPI up", [0x40, 0x02, 0x00]],
275
+ ["DPI down", [0x40, 0x03, 0x00]],
276
+ ["Disabled", [0x60, 0x00, 0x00]],
277
+ ["Mode switch", [0x60, 0x01, 0x00]],
278
+ ["Lighting toggle", [0x60, 0x04, 0x00]],
279
+ ["Tilt left", [0x60, 0x06, 0x00]],
280
+ ["Tilt right", [0x60, 0x07, 0x00]],
281
+ ["Show desktop", [0x60, 0x08, 0x00]],
282
+ ["Select all", [0x70, 0x01, 0x04]],
283
+ ["Copy", [0x70, 0x01, 0x06]],
284
+ ["New", [0x70, 0x01, 0x11]],
285
+ ["Print", [0x70, 0x01, 0x13]],
286
+ ["Save", [0x70, 0x01, 0x16]],
287
+ ["Paste", [0x70, 0x01, 0x19]],
288
+ ["Cut", [0x70, 0x01, 0x1b]],
289
+ ["Undo", [0x70, 0x01, 0x1d]],
290
+ ["Open", [0x70, 0x08, 0x08]],
291
+ ["Media player", [0x80, 0x83, 0x01]],
292
+ ["Email", [0x80, 0x8a, 0x01]],
293
+ ["Calculator", [0x80, 0x92, 0x01]],
294
+ ["Next track", [0x80, 0xb5, 0x00]],
295
+ ["Previous track", [0x80, 0xb6, 0x00]],
296
+ ["Stop", [0x80, 0xb7, 0x00]],
297
+ ["Play or pause", [0x80, 0xcd, 0x00]],
298
+ ["Mute", [0x80, 0xe2, 0x00]],
299
+ ["Volume up", [0x80, 0xe9, 0x00]],
300
+ ["Volume down", [0x80, 0xea, 0x00]],
301
+ ]);
302
+ export function ryunixButtonActionName(code) {
303
+ for (const [name, value] of RYUNIX_BUTTON_ACTIONS) {
304
+ if (value[0] === code[0] && value[1] === code[1] && value[2] === code[2])
305
+ return name;
306
+ }
307
+ return null;
308
+ }
309
+ /**
310
+ * Button positions in the order the firmware stores them (the vendor app sends
311
+ * its buttons as 0,1,2,6,5,3,4,7,8, which is this order). Names follow the
312
+ * physical layout in Amkette's XS Flow 2 Speed configurator: its buttons 4 and
313
+ * 5 are the two small buttons under the wheel (default "show desktop" and "DPI
314
+ * cycle"), 6 and 7 the thumb pair, 8 and 9 the wheel tilt. Its button 10, the
315
+ * bottom mode switch, is left out so the 2.4 GHz/Bluetooth/USB switch cannot be
316
+ * remapped away.
317
+ */
318
+ export const RYUNIX_BUTTON_SLOTS = [
319
+ { id: "Left", name: "Left button", factory: "Left click" },
320
+ { id: "Right", name: "Right button", factory: "Right click" },
321
+ { id: "Middle", name: "Wheel button", factory: "Middle click" },
322
+ { id: "Back", name: "Back button", factory: "Back" },
323
+ { id: "Forward", name: "Forward button", factory: "Forward" },
324
+ { id: "Upper", name: "Upper centre button", factory: "Show desktop" },
325
+ { id: "Dpi", name: "DPI button", factory: "DPI cycle" },
326
+ { id: "TiltLeft", name: "Wheel tilt left", factory: "Tilt left" },
327
+ { id: "TiltRight", name: "Wheel tilt right", factory: "Tilt right" },
328
+ ];
329
+ export const RYUNIX_BUTTON_POSITIONS = 10;
330
+ /**
331
+ * What each of the ten positions holds in the vendor app's default layout, in
332
+ * firmware order. Position 9 is the bottom mode switch, which is not offered for
333
+ * remapping but is part of every button write. The vendor app writes all ten
334
+ * from this layout, so a write that has to fill positions it was not asked to
335
+ * change uses these rather than 0xFF, whose meaning on this firmware is unknown.
336
+ */
337
+ export const RYUNIX_BUTTON_FACTORY_CODES = [
338
+ [0x10, 0x01, 0x00],
339
+ [0x10, 0x02, 0x00],
340
+ [0x10, 0x04, 0x00],
341
+ [0x10, 0x08, 0x00],
342
+ [0x10, 0x10, 0x00],
343
+ [0x60, 0x08, 0x00],
344
+ [0x40, 0x01, 0x00],
345
+ [0x60, 0x06, 0x00],
346
+ [0x60, 0x07, 0x00],
347
+ [0x60, 0x01, 0x00],
348
+ ];
349
+ /**
350
+ * Button table frames for the ten-position layout the XS Flow configurator
351
+ * uses: positions 0-8 in a first frame (sub 0x02) and position 9 in a second
352
+ * (sub 0x12). `positions[i]` is `null` for 0xFF 0xFF 0xFF, which the vendor app
353
+ * writes for a button it has no assignment for.
354
+ */
355
+ export function ryunixSetButtonsFrames(sequences, positions) {
356
+ const unset = [0xff, 0xff, 0xff];
357
+ const at = (index) => positions[index] ?? unset;
358
+ const first = [];
359
+ for (let index = 0; index < 9; index++)
360
+ first.push(...at(index));
361
+ return [
362
+ ryunixFrame(RYUNIX_COMMAND.buttons, sequences[0], 0x02, first),
363
+ ryunixFrame(RYUNIX_COMMAND.buttons, sequences[1], 0x12, [...at(9)]),
364
+ ];
365
+ }
366
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/ryunix/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE,IAAI;IACb,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,IAAI;IACrB,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;IACX,aAAa,EAAE,IAAI;IACn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GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACjE,OAAO;QACL,WAAW,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC;QAC9D,WAAW,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;KACpE,CAAC;AACJ,CAAC"}
@@ -15,6 +15,11 @@ import type { LamzuAtlantisProduct } from "../lamzu/atlantis.js";
15
15
  * 0x3554:0xf515 and its "Scyrox Turbo 8k dongle" receiver 0x3554:0xf517 — see
16
16
  * docs/scyrox-v8s-testing.md. Every other flash field the Atlantis client
17
17
  * reads decoded cleanly on both transports; no write has been exercised yet.
18
+ *
19
+ * The older V8 ("SCYROX 8K Dongle", 0x3554:0xf5f7, mouse firmware v2.22) runs
20
+ * a 3950 sensor and keeps its DPI stages in the legacy fields; it was read on
21
+ * hardware and its polling rate written and read back, see
22
+ * docs/scyrox-v8-testing.md.
18
23
  */
19
24
  export declare const SCYROX_VENDOR_ID = 13652;
20
25
  /** The V8S identity from the command 0x01 handshake, read on wired 0xf515. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scyrox/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,QAAS,CAAC;AAEvC,8EAA8E;AAC9E,eAAO,MAAM,cAAc,KAAO,CAAC;AACnC,eAAO,MAAM,cAAc,IAAO,CAAC;AAEnC,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAAqB,CAAC;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,+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