@openmouse/protocol 0.42.2 → 0.43.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/registry.d.ts +13 -1
- package/dist/drivers/registry.d.ts.map +1 -1
- package/dist/drivers/registry.js +24 -0
- package/dist/drivers/registry.js.map +1 -1
- package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.d.ts +65 -0
- package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.js +205 -0
- package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.js.map +1 -0
- package/dist/drivers/steelseries/prime-mini-hid.d.ts +59 -0
- package/dist/drivers/steelseries/prime-mini-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/prime-mini-hid.js +183 -0
- package/dist/drivers/steelseries/prime-mini-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-100-hid.d.ts +57 -0
- package/dist/drivers/steelseries/rival-100-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-100-hid.js +181 -0
- package/dist/drivers/steelseries/rival-100-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-110-hid.d.ts +78 -0
- package/dist/drivers/steelseries/rival-110-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-110-hid.js +206 -0
- package/dist/drivers/steelseries/rival-110-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-3-v2-hid.d.ts +59 -0
- package/dist/drivers/steelseries/rival-3-v2-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-3-v2-hid.js +183 -0
- package/dist/drivers/steelseries/rival-3-v2-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-3-wireless-v2-hid.d.ts +64 -0
- package/dist/drivers/steelseries/rival-3-wireless-v2-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-3-wireless-v2-hid.js +199 -0
- package/dist/drivers/steelseries/rival-3-wireless-v2-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-300-hid.d.ts +78 -0
- package/dist/drivers/steelseries/rival-300-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-300-hid.js +206 -0
- package/dist/drivers/steelseries/rival-300-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-5-hid.d.ts +55 -0
- package/dist/drivers/steelseries/rival-5-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-5-hid.js +177 -0
- package/dist/drivers/steelseries/rival-5-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-600-hid.d.ts +65 -0
- package/dist/drivers/steelseries/rival-600-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-600-hid.js +184 -0
- package/dist/drivers/steelseries/rival-600-hid.js.map +1 -0
- package/dist/drivers/steelseries/sensei-310-hid.d.ts +54 -0
- package/dist/drivers/steelseries/sensei-310-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/sensei-310-hid.js +177 -0
- package/dist/drivers/steelseries/sensei-310-hid.js.map +1 -0
- package/dist/drivers/steelseries/sensei-raw-hid.d.ts +75 -0
- package/dist/drivers/steelseries/sensei-raw-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/sensei-raw-hid.js +199 -0
- package/dist/drivers/steelseries/sensei-raw-hid.js.map +1 -0
- package/dist/drivers/steelseries/sensei-rival-pro-hid.d.ts +42 -0
- package/dist/drivers/steelseries/sensei-rival-pro-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/sensei-rival-pro-hid.js +132 -0
- package/dist/drivers/steelseries/sensei-rival-pro-hid.js.map +1 -0
- package/dist/finalmouse/index.d.ts.map +1 -1
- package/dist/finalmouse/index.js +6 -2
- package/dist/finalmouse/index.js.map +1 -1
- package/dist/steelseries/aerox-3-wireless-gen2.d.ts +204 -0
- package/dist/steelseries/aerox-3-wireless-gen2.d.ts.map +1 -0
- package/dist/steelseries/aerox-3-wireless-gen2.js +301 -0
- package/dist/steelseries/aerox-3-wireless-gen2.js.map +1 -0
- package/dist/steelseries/aerox3.d.ts +3 -3
- package/dist/steelseries/aerox3.js +3 -3
- package/dist/steelseries/devices.d.ts +31 -14
- package/dist/steelseries/devices.d.ts.map +1 -1
- package/dist/steelseries/devices.js +417 -13
- package/dist/steelseries/devices.js.map +1 -1
- package/dist/steelseries/index.d.ts +12 -0
- package/dist/steelseries/index.d.ts.map +1 -1
- package/dist/steelseries/index.js +12 -0
- package/dist/steelseries/index.js.map +1 -1
- package/dist/steelseries/prime-mini-wireless.d.ts +9 -14
- package/dist/steelseries/prime-mini-wireless.d.ts.map +1 -1
- package/dist/steelseries/prime-mini-wireless.js +9 -14
- package/dist/steelseries/prime-mini-wireless.js.map +1 -1
- package/dist/steelseries/prime-mini.d.ts +173 -0
- package/dist/steelseries/prime-mini.d.ts.map +1 -0
- package/dist/steelseries/prime-mini.js +273 -0
- package/dist/steelseries/prime-mini.js.map +1 -0
- package/dist/steelseries/prime-plus.d.ts +5 -4
- package/dist/steelseries/prime-plus.d.ts.map +1 -1
- package/dist/steelseries/prime-plus.js +5 -4
- package/dist/steelseries/prime-plus.js.map +1 -1
- package/dist/steelseries/rival-100.d.ts +134 -0
- package/dist/steelseries/rival-100.d.ts.map +1 -0
- package/dist/steelseries/rival-100.js +195 -0
- package/dist/steelseries/rival-100.js.map +1 -0
- package/dist/steelseries/rival-110.d.ts +134 -0
- package/dist/steelseries/rival-110.d.ts.map +1 -0
- package/dist/steelseries/rival-110.js +205 -0
- package/dist/steelseries/rival-110.js.map +1 -0
- package/dist/steelseries/rival-3-v2.d.ts +168 -0
- package/dist/steelseries/rival-3-v2.d.ts.map +1 -0
- package/dist/steelseries/rival-3-v2.js +242 -0
- package/dist/steelseries/rival-3-v2.js.map +1 -0
- package/dist/steelseries/rival-3-wireless-v2.d.ts +219 -0
- package/dist/steelseries/rival-3-wireless-v2.d.ts.map +1 -0
- package/dist/steelseries/rival-3-wireless-v2.js +270 -0
- package/dist/steelseries/rival-3-wireless-v2.js.map +1 -0
- package/dist/steelseries/rival-300.d.ts +163 -0
- package/dist/steelseries/rival-300.d.ts.map +1 -0
- package/dist/steelseries/rival-300.js +266 -0
- package/dist/steelseries/rival-300.js.map +1 -0
- package/dist/steelseries/rival-5.d.ts +165 -0
- package/dist/steelseries/rival-5.d.ts.map +1 -0
- package/dist/steelseries/rival-5.js +212 -0
- package/dist/steelseries/rival-5.js.map +1 -0
- package/dist/steelseries/rival-600.d.ts +194 -0
- package/dist/steelseries/rival-600.d.ts.map +1 -0
- package/dist/steelseries/rival-600.js +262 -0
- package/dist/steelseries/rival-600.js.map +1 -0
- package/dist/steelseries/sensei-310.d.ts +162 -0
- package/dist/steelseries/sensei-310.d.ts.map +1 -0
- package/dist/steelseries/sensei-310.js +250 -0
- package/dist/steelseries/sensei-310.js.map +1 -0
- package/dist/steelseries/sensei-raw.d.ts +169 -0
- package/dist/steelseries/sensei-raw.d.ts.map +1 -0
- package/dist/steelseries/sensei-raw.js +233 -0
- package/dist/steelseries/sensei-raw.js.map +1 -0
- package/dist/steelseries/sensei-rival-pro.d.ts +214 -0
- package/dist/steelseries/sensei-rival-pro.d.ts.map +1 -0
- package/dist/steelseries/sensei-rival-pro.js +298 -0
- package/dist/steelseries/sensei-rival-pro.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SteelSeries Prime Mini configuration protocol — pure encode/decode helpers.
|
|
3
|
+
*
|
|
4
|
+
* Reconstructed from the vendor's own software, not from a third-party
|
|
5
|
+
* reimplementation: SteelSeries GG 121.0.0 ships `prime_mini.lisp` under
|
|
6
|
+
* `apps/engine/install/deviceSpecifications/`, and this module transcribes
|
|
7
|
+
* it. Those files are OpenPGP-armored ("DESCRIPTOR" armor, SKESK/AES-128);
|
|
8
|
+
* the bytes below are the documented HID report payloads, not guesses.
|
|
9
|
+
* Do not confuse this wired-only mouse (`1038:184D`) with the Prime Mini
|
|
10
|
+
* Wireless (`1038:184A`/`1038:1848`, family `"prime-mini-wireless"`),
|
|
11
|
+
* which shares the plain Prime Wireless command set — see
|
|
12
|
+
* `./prime-mini-wireless.ts`. No other public implementation of this
|
|
13
|
+
* protocol was available to corroborate against, so treat every byte as
|
|
14
|
+
* vendor-documented but not yet hardware-verified.
|
|
15
|
+
*
|
|
16
|
+
* Every command is an HID **output report** with report id 0x00 (65-byte
|
|
17
|
+
* reports throughout the specification).
|
|
18
|
+
*
|
|
19
|
+
* DPI uses a 5-preset batch (`0x2D`): `level_max` (1–5), `active_level`
|
|
20
|
+
* (0–4, 0-based), then five uint16 little-endian factors, each multiplied
|
|
21
|
+
* by 50 (`DPI = factor × 50`, range factor 1–360, i.e. 50–18000 DPI). The
|
|
22
|
+
* specification always carries all five slots, so this codec requires
|
|
23
|
+
* exactly five presets rather than guessing at padding for shorter tables.
|
|
24
|
+
* The factory table is 400/800/1200/2400/3200 (sensor bytes 8/16/24/48/64
|
|
25
|
+
* in the GG seed data).
|
|
26
|
+
*
|
|
27
|
+
* Polling (`0x2B`, values 1000→0x01, 500→0x02, 250→0x03, 125→0x04) has a
|
|
28
|
+
* read-back (`0xAB`, same values), defined but not decoded here. Buttons
|
|
29
|
+
* are one 40-byte packet (8 slots × 5-byte fields), command `0x2A`: the
|
|
30
|
+
* vendor frontend always forces the 6th slot to DPI-switch and only exposes
|
|
31
|
+
* 5 remappable buttons plus scroll, so this codec defaults that slot to
|
|
32
|
+
* DPI-switch while still encoding an explicit caller override verbatim.
|
|
33
|
+
*
|
|
34
|
+
* Lighting is a single zone: color (`0x21`, zone byte `0x00` + RGB),
|
|
35
|
+
* brightness (`0x23`, 0–100), default lighting (`0x27`, off/rainbow) with a
|
|
36
|
+
* read-back, and reset (`0x22`).
|
|
37
|
+
*
|
|
38
|
+
* Known but deliberately not implemented — documented so nobody re-derives
|
|
39
|
+
* them, withheld until there is hardware evidence and a reason to ship them:
|
|
40
|
+
*
|
|
41
|
+
* - `0xAB` — polling read-back; `0x27` — default-lighting read-back.
|
|
42
|
+
* - `0x90 0x00` — firmware version (15-byte string reply); implemented as
|
|
43
|
+
* query + decoder below because the driver needs a connectivity probe.
|
|
44
|
+
* - Accelerometer/deceleration, angle snapping, sleep timers: driver-side
|
|
45
|
+
* (`SSE`) settings, not HID commands, out of scope for this codec.
|
|
46
|
+
*
|
|
47
|
+
* Settings apply immediately; the save command (`0x11`, one byte — no
|
|
48
|
+
* `0x00` suffix, unlike Aerox's `11 00`) persists them to onboard flash.
|
|
49
|
+
* None of this has been verified on physical hardware by this project.
|
|
50
|
+
*/
|
|
51
|
+
export const PRIME_MINI_REPORT_ID = 0x00;
|
|
52
|
+
/** Command prefixes; the payload is the prefix plus its arguments. */
|
|
53
|
+
export const PRIME_MINI_COMMAND = {
|
|
54
|
+
dpiPresets: [0x2d],
|
|
55
|
+
pollingRate: [0x2b],
|
|
56
|
+
buttonsMapping: [0x2a],
|
|
57
|
+
ledBrightness: [0x23],
|
|
58
|
+
defaultLighting: [0x27],
|
|
59
|
+
zoneColor: [0x21],
|
|
60
|
+
resetLighting: [0x22],
|
|
61
|
+
firmware: [0x90, 0x00],
|
|
62
|
+
};
|
|
63
|
+
/** `0xAB` — polling read-back; documented, not decoded here. */
|
|
64
|
+
export const PRIME_MINI_POLLING_QUERY = [0xab];
|
|
65
|
+
/** `0x11` — one byte, no suffix. Distinct from Aerox's two-byte `11 00`. */
|
|
66
|
+
export const PRIME_MINI_SAVE_COMMAND = [0x11];
|
|
67
|
+
export const PRIME_MINI_POLLING_RATES = [125, 250, 500, 1000];
|
|
68
|
+
const POLLING_RATE_TO_BYTE = new Map([
|
|
69
|
+
[1000, 0x01],
|
|
70
|
+
[500, 0x02],
|
|
71
|
+
[250, 0x03],
|
|
72
|
+
[125, 0x04],
|
|
73
|
+
]);
|
|
74
|
+
/** DPI = factor × 50; factor 1–360, i.e. 50–18000 DPI in 50 DPI steps. */
|
|
75
|
+
export const PRIME_MINI_DPI_MIN = 50;
|
|
76
|
+
export const PRIME_MINI_DPI_MAX = 18000;
|
|
77
|
+
export const PRIME_MINI_DPI_STEP = 50;
|
|
78
|
+
export const PRIME_MINI_MAX_DPI_PRESETS = 5;
|
|
79
|
+
export const PRIME_MINI_FIRMWARE_RESPONSE_LENGTH = 15;
|
|
80
|
+
/** Factory table from the GG seed data (sensor bytes 8/16/24/48/64). */
|
|
81
|
+
export const PRIME_MINI_DEFAULT_DPI_PRESETS = [400, 800, 1200, 2400, 3200];
|
|
82
|
+
export const PRIME_MINI_DEFAULT_POLLING_RATE = 1000;
|
|
83
|
+
export class PrimeMiniProtocolError extends Error {
|
|
84
|
+
}
|
|
85
|
+
/** Every DPI value the factor encoding can express, ascending. */
|
|
86
|
+
export function steelseriesPrimeMiniDpiOptions() {
|
|
87
|
+
const options = [];
|
|
88
|
+
for (let dpi = PRIME_MINI_DPI_MIN; dpi <= PRIME_MINI_DPI_MAX; dpi += PRIME_MINI_DPI_STEP) {
|
|
89
|
+
options.push(dpi);
|
|
90
|
+
}
|
|
91
|
+
return options;
|
|
92
|
+
}
|
|
93
|
+
function encodeDpiFactor(dpi) {
|
|
94
|
+
if (!Number.isInteger(dpi) ||
|
|
95
|
+
dpi < PRIME_MINI_DPI_MIN ||
|
|
96
|
+
dpi > PRIME_MINI_DPI_MAX ||
|
|
97
|
+
(dpi - PRIME_MINI_DPI_MIN) % PRIME_MINI_DPI_STEP !== 0) {
|
|
98
|
+
throw new PrimeMiniProtocolError(`SteelSeries Prime Mini DPI must be ${PRIME_MINI_DPI_MIN}–${PRIME_MINI_DPI_MAX.toLocaleString("en-US")} in ${PRIME_MINI_DPI_STEP} DPI steps.`);
|
|
99
|
+
}
|
|
100
|
+
const factor = dpi / PRIME_MINI_DPI_STEP;
|
|
101
|
+
return [factor & 0xff, (factor >> 8) & 0xff];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* `2D <count 1–5> <selected 0-based> <5× u16LE factor>` — replaces the
|
|
105
|
+
* mouse's whole preset table. Exactly five presets are required (see the
|
|
106
|
+
* module doc comment); `selectedIndex` is 0-based here and on the wire.
|
|
107
|
+
*/
|
|
108
|
+
export function steelseriesPrimeMiniEncodeDpiPresets(presets, selectedIndex) {
|
|
109
|
+
if (presets.length !== PRIME_MINI_MAX_DPI_PRESETS) {
|
|
110
|
+
throw new PrimeMiniProtocolError(`SteelSeries Prime Mini requires exactly ${PRIME_MINI_MAX_DPI_PRESETS} DPI presets.`);
|
|
111
|
+
}
|
|
112
|
+
if (!Number.isInteger(selectedIndex) || selectedIndex < 0 || selectedIndex >= presets.length) {
|
|
113
|
+
throw new PrimeMiniProtocolError(`Selected DPI preset must be an index into the ${presets.length} presets being written.`);
|
|
114
|
+
}
|
|
115
|
+
return new Uint8Array([
|
|
116
|
+
...PRIME_MINI_COMMAND.dpiPresets,
|
|
117
|
+
presets.length,
|
|
118
|
+
selectedIndex,
|
|
119
|
+
...presets.flatMap(encodeDpiFactor),
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
122
|
+
/** `2B <v>` with 1000→0x01, 500→0x02, 250→0x03, 125→0x04. */
|
|
123
|
+
export function steelseriesPrimeMiniEncodePollingRate(pollingRateHz) {
|
|
124
|
+
const byte = POLLING_RATE_TO_BYTE.get(pollingRateHz);
|
|
125
|
+
if (byte === undefined) {
|
|
126
|
+
throw new PrimeMiniProtocolError("SteelSeries Prime Mini supports 125, 250, 500, or 1000 Hz polling.");
|
|
127
|
+
}
|
|
128
|
+
return new Uint8Array([...PRIME_MINI_COMMAND.pollingRate, byte]);
|
|
129
|
+
}
|
|
130
|
+
/** `11` — commit the current settings to onboard flash. */
|
|
131
|
+
export function steelseriesPrimeMiniSaveCommand() {
|
|
132
|
+
return new Uint8Array(PRIME_MINI_SAVE_COMMAND);
|
|
133
|
+
}
|
|
134
|
+
/** `90 00` — the device answers with a 15-byte version string. */
|
|
135
|
+
export function steelseriesPrimeMiniFirmwareQuery() {
|
|
136
|
+
return new Uint8Array(PRIME_MINI_COMMAND.firmware);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Decode the 15-byte firmware version reply as ASCII, stopping at the
|
|
140
|
+
* first NUL. The string shape (dotted version text) follows the
|
|
141
|
+
* specification's `version_str bytearray (size 15)` field; trailing
|
|
142
|
+
* padding is not part of the version.
|
|
143
|
+
*/
|
|
144
|
+
export function steelseriesPrimeMiniDecodeFirmware(payload) {
|
|
145
|
+
if (payload.length < PRIME_MINI_FIRMWARE_RESPONSE_LENGTH) {
|
|
146
|
+
throw new PrimeMiniProtocolError("SteelSeries Prime Mini firmware response is shorter than 15 bytes.");
|
|
147
|
+
}
|
|
148
|
+
const bytes = payload.slice(0, PRIME_MINI_FIRMWARE_RESPONSE_LENGTH);
|
|
149
|
+
const nul = bytes.indexOf(0x00);
|
|
150
|
+
const text = new TextDecoder("ascii").decode(nul === -1 ? bytes : bytes.slice(0, nul));
|
|
151
|
+
return text;
|
|
152
|
+
}
|
|
153
|
+
function encodeRgb(r, g, b) {
|
|
154
|
+
for (const channel of [r, g, b]) {
|
|
155
|
+
if (!Number.isInteger(channel) || channel < 0 || channel > 255) {
|
|
156
|
+
throw new PrimeMiniProtocolError("RGB channels must be integers 0–255.");
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return [r, g, b];
|
|
160
|
+
}
|
|
161
|
+
/** `21 00 <r> <g> <b>` — the single LED zone color. */
|
|
162
|
+
export function steelseriesPrimeMiniEncodeZoneColor(r, g, b) {
|
|
163
|
+
return new Uint8Array([...PRIME_MINI_COMMAND.zoneColor, 0x00, ...encodeRgb(r, g, b)]);
|
|
164
|
+
}
|
|
165
|
+
/** `23 <v>` — LED brightness, linear 0–100 passthrough. */
|
|
166
|
+
export function steelseriesPrimeMiniEncodeLedBrightness(percent) {
|
|
167
|
+
if (!Number.isInteger(percent) || percent < 0 || percent > 100) {
|
|
168
|
+
throw new PrimeMiniProtocolError("SteelSeries Prime Mini LED brightness must be an integer 0–100.");
|
|
169
|
+
}
|
|
170
|
+
return new Uint8Array([...PRIME_MINI_COMMAND.ledBrightness, percent]);
|
|
171
|
+
}
|
|
172
|
+
export const PRIME_MINI_DEFAULT_LIGHTING = {
|
|
173
|
+
off: 0x00,
|
|
174
|
+
rainbow: 0x01,
|
|
175
|
+
};
|
|
176
|
+
/** `27 <v>` — boot lighting: off or rainbow. */
|
|
177
|
+
export function steelseriesPrimeMiniEncodeDefaultLighting(mode) {
|
|
178
|
+
const byte = PRIME_MINI_DEFAULT_LIGHTING[mode];
|
|
179
|
+
if (byte === undefined) {
|
|
180
|
+
throw new PrimeMiniProtocolError(`SteelSeries Prime Mini default lighting must be one of: ${Object.keys(PRIME_MINI_DEFAULT_LIGHTING).join(", ")}.`);
|
|
181
|
+
}
|
|
182
|
+
return new Uint8Array([...PRIME_MINI_COMMAND.defaultLighting, byte]);
|
|
183
|
+
}
|
|
184
|
+
/** `22` — reset the lighting to boot defaults. */
|
|
185
|
+
export function steelseriesPrimeMiniResetLightingCommand() {
|
|
186
|
+
return new Uint8Array(PRIME_MINI_COMMAND.resetLighting);
|
|
187
|
+
}
|
|
188
|
+
// -- Button mapping --------------------------------------------------------
|
|
189
|
+
/** `buttons_mapping` slots: 6 physical buttons plus scroll up/down. */
|
|
190
|
+
export const PRIME_MINI_BUTTONS = {
|
|
191
|
+
button1: { id: 0x01, offset: 0x00 },
|
|
192
|
+
button2: { id: 0x02, offset: 0x05 },
|
|
193
|
+
button3: { id: 0x03, offset: 0x0a },
|
|
194
|
+
button4: { id: 0x04, offset: 0x0f },
|
|
195
|
+
button5: { id: 0x05, offset: 0x14 },
|
|
196
|
+
button6: { id: 0x06, offset: 0x19 },
|
|
197
|
+
scrollUp: { id: 0x31, offset: 0x1e },
|
|
198
|
+
scrollDown: { id: 0x32, offset: 0x23 },
|
|
199
|
+
};
|
|
200
|
+
const BUTTON_FIELD_LENGTH = 5;
|
|
201
|
+
const BUTTON_DISABLE = 0x00;
|
|
202
|
+
const BUTTON_DPI_SWITCH = 0x30;
|
|
203
|
+
const BUTTON_KEYBOARD = 0x51;
|
|
204
|
+
const BUTTON_MULTIMEDIA = 0x61;
|
|
205
|
+
/** The vendor frontend forces this slot to DPI-switch; the codec default matches. */
|
|
206
|
+
export const PRIME_MINI_DEFAULT_BUTTONS = {
|
|
207
|
+
button1: { type: "button", target: "button1" },
|
|
208
|
+
button2: { type: "button", target: "button2" },
|
|
209
|
+
button3: { type: "button", target: "button3" },
|
|
210
|
+
button4: { type: "button", target: "button4" },
|
|
211
|
+
button5: { type: "button", target: "button5" },
|
|
212
|
+
button6: { type: "dpiSwitch" },
|
|
213
|
+
scrollUp: { type: "button", target: "scrollUp" },
|
|
214
|
+
scrollDown: { type: "button", target: "scrollDown" },
|
|
215
|
+
};
|
|
216
|
+
function encodeKeyCode(code, kind) {
|
|
217
|
+
if (!Number.isInteger(code) || code < 0 || code > 255) {
|
|
218
|
+
throw new PrimeMiniProtocolError(`${kind} codes must be integers 0–255.`);
|
|
219
|
+
}
|
|
220
|
+
return code;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* `2A` + one 40-byte packet (8 slots × 5-byte fields). Like the Aerox
|
|
224
|
+
* wireless families, a button missing from `mapping` keeps its default
|
|
225
|
+
* action (identity, except the DPI button, which keeps DPI-switch per the
|
|
226
|
+
* vendor frontend's forced mapping), so remapping one button never
|
|
227
|
+
* disables the others. An explicit `button6` entry is encoded verbatim.
|
|
228
|
+
*/
|
|
229
|
+
export function steelseriesPrimeMiniEncodeButtonsMapping(mapping) {
|
|
230
|
+
for (const name of Object.keys(mapping)) {
|
|
231
|
+
if (!Object.hasOwn(PRIME_MINI_BUTTONS, name)) {
|
|
232
|
+
throw new PrimeMiniProtocolError(`Unknown SteelSeries Prime Mini button "${name}".`);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const names = Object.keys(PRIME_MINI_BUTTONS);
|
|
236
|
+
const packet = new Array(names.length * BUTTON_FIELD_LENGTH).fill(0x00);
|
|
237
|
+
for (const name of names) {
|
|
238
|
+
const action = mapping[name] ?? PRIME_MINI_DEFAULT_BUTTONS[name];
|
|
239
|
+
const { offset } = PRIME_MINI_BUTTONS[name];
|
|
240
|
+
switch (action.type) {
|
|
241
|
+
case "button": {
|
|
242
|
+
if (!Object.hasOwn(PRIME_MINI_BUTTONS, action.target)) {
|
|
243
|
+
throw new PrimeMiniProtocolError(`Unknown SteelSeries Prime Mini button "${action.target}".`);
|
|
244
|
+
}
|
|
245
|
+
packet[offset] = PRIME_MINI_BUTTONS[action.target].id;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
case "disabled": {
|
|
249
|
+
packet[offset] = BUTTON_DISABLE;
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
case "dpiSwitch": {
|
|
253
|
+
packet[offset] = BUTTON_DPI_SWITCH;
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
case "keyboard": {
|
|
257
|
+
packet[offset] = BUTTON_KEYBOARD;
|
|
258
|
+
packet[offset + 1] = encodeKeyCode(action.code, "Keyboard scan");
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
case "multimedia": {
|
|
262
|
+
packet[offset] = BUTTON_MULTIMEDIA;
|
|
263
|
+
packet[offset + 1] = encodeKeyCode(action.code, "Multimedia key");
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
default: {
|
|
267
|
+
throw new PrimeMiniProtocolError("Unsupported SteelSeries Prime Mini button action.");
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return new Uint8Array([...PRIME_MINI_COMMAND.buttonsMapping, ...packet]);
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=prime-mini.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prime-mini.js","sourceRoot":"","sources":["../../src/steelseries/prime-mini.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GA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M,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;gBACjE,MAAM;YACR,CAAC;YACD,KAAK,YAAY,CAAC,CAAC,CAAC;gBAClB,MAAM,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAC;gBACnC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBAClE,MAAM;YACR,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,IAAI,sBAAsB,CAAC,mDAAmD,CAAC,CAAC;YACxF,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,kBAAkB,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
* libratbag, nor the OpenRGB SteelSeries controller sources reachable from
|
|
18
18
|
* this environment (see corroboration gap below) expose any command for it.
|
|
19
19
|
* Prime+ is still implemented as its own module/PID/family rather than
|
|
20
|
-
* folded into a shared "Prime" module
|
|
21
|
-
*
|
|
22
|
-
* implemented here is not distinguishable from plain
|
|
23
|
-
* should not infer an OLED command exists just
|
|
20
|
+
* folded into a shared "Prime" module; the plain Prime PIDs (`0x182E`,
|
|
21
|
+
* `0x182A`, `0x1856`) reuse this codec via `./devices.ts` because the
|
|
22
|
+
* wire protocol implemented here is not distinguishable from plain
|
|
23
|
+
* Prime's, and a reader should not infer an OLED command exists just
|
|
24
|
+
* because this module exists.
|
|
24
25
|
* - rivalcfg `rivalcfg/handlers/multidpi_range.py` (DPI presets: `merge_bytes(
|
|
25
26
|
* count, selected_preset, ...values)`, `count_mode: "number"`, 2-byte
|
|
26
27
|
* little-endian DPI values here vs. Aerox 3's 1-byte) and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prime-plus.d.ts","sourceRoot":"","sources":["../../src/steelseries/prime-plus.ts"],"names":[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;;;;;;;;;;;;;;CAOyB,CAAC;AAEzD,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAUlE,2BAA2B;AAC3B,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC,GACnE,UAAU,CA0DZ"}
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
* libratbag, nor the OpenRGB SteelSeries controller sources reachable from
|
|
18
18
|
* this environment (see corroboration gap below) expose any command for it.
|
|
19
19
|
* Prime+ is still implemented as its own module/PID/family rather than
|
|
20
|
-
* folded into a shared "Prime" module
|
|
21
|
-
*
|
|
22
|
-
* implemented here is not distinguishable from plain
|
|
23
|
-
* should not infer an OLED command exists just
|
|
20
|
+
* folded into a shared "Prime" module; the plain Prime PIDs (`0x182E`,
|
|
21
|
+
* `0x182A`, `0x1856`) reuse this codec via `./devices.ts` because the
|
|
22
|
+
* wire protocol implemented here is not distinguishable from plain
|
|
23
|
+
* Prime's, and a reader should not infer an OLED command exists just
|
|
24
|
+
* because this module exists.
|
|
24
25
|
* - rivalcfg `rivalcfg/handlers/multidpi_range.py` (DPI presets: `merge_bytes(
|
|
25
26
|
* count, selected_preset, ...values)`, `count_mode: "number"`, 2-byte
|
|
26
27
|
* little-endian DPI values here vs. Aerox 3's 1-byte) and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prime-plus.js","sourceRoot":"","sources":["../../src/steelseries/prime-plus.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prime-plus.js","sourceRoot":"","sources":["../../src/steelseries/prime-plus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,WAAW,EAAE,CAAC,IAAI,CAAC;IACnB,WAAW,EAAE,CAAC,IAAI,CAAC;IACnB,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACnB,aAAa,EAAE,CAAC,IAAI,CAAC;IACrB,cAAc,EAAE,CAAC,IAAI,CAAC;CACd,CAAC;AAEX,2GAA2G;AAC3G,MAAM,YAAY,GAAG;IACnB,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,IAAI;CACI,CAAC;AAEX,iFAAiF;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAI,CAAU,CAAC;AAEvD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAEvE,MAAM,oBAAoB,GAAgC,IAAI,GAAG,CAAC;IAChE,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,G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I,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC;oBAC3E,MAAM,IAAI,sBAAsB,CAAC,8CAA8C,CAAC,CAAC;gBACnF,CAAC;gBACD,MAAM,CAAC,MAAM,CAAC,GAAG,4BAA4B,CAAC;gBAC9C,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;gBACjC,MAAM;YACR,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,IAAI,sBAAsB,CAAC,+CAA+C,CAAC,CAAC;YACpF,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,kBAAkB,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SteelSeries Rival 100 configuration protocol — pure encode/decode helpers.
|
|
3
|
+
*
|
|
4
|
+
* Reconstructed from the vendor's own software, not from a third-party
|
|
5
|
+
* reimplementation: SteelSeries GG 121.0.0 ships `rival-100.lisp` (plus the
|
|
6
|
+
* `rival-100-dell-china`, `rival-100-pc-bang`, `dota2-rival-100-retail`,
|
|
7
|
+
* `dota2-rival-100-lenovo` and `rival-105` files, all of which `include
|
|
8
|
+
* "rival-100"`) under `apps/engine/install/deviceSpecifications/`, and this
|
|
9
|
+
* module transcribes it. Those files are OpenPGP-armored ("DESCRIPTOR"
|
|
10
|
+
* armor, SKESK/AES-128); the bytes below are the documented HID report
|
|
11
|
+
* payloads, not guesses. rivalcfg's `rival100.py` (which lists the same
|
|
12
|
+
* Rival 100/105 product ids) independently corroborates the command bytes.
|
|
13
|
+
*
|
|
14
|
+
* This is the first-generation "rival 100 family" command set shared by the
|
|
15
|
+
* Rival 100, Rival 105, and every Rival 100 special edition. It is not the
|
|
16
|
+
* Rival 110/106/300S command set: those share the same command bytes but use
|
|
17
|
+
* a different sensor table (PixArt PMW3326, 200–7200 DPI), which needs its
|
|
18
|
+
* own module. Do not extend this one to cover them.
|
|
19
|
+
*
|
|
20
|
+
* Every command is an HID **output report** with report id 0x00 (33-byte
|
|
21
|
+
* reports — `HIDIO 33`). Unlike the modern families, **buttons are not
|
|
22
|
+
* remappable** at all: the vendor file stubs `button_mappings`/
|
|
23
|
+
* `wheel_mappings` out as empty, and the only button control is a "button 6
|
|
24
|
+
* mode" toggle (`0B`), which switches the CPI button under the wheel between
|
|
25
|
+
* hardware DPI switching and an OS-bound button.
|
|
26
|
+
*
|
|
27
|
+
* DPI uses two per-level commands (`03 01`/`03 02`) with a **choice** byte,
|
|
28
|
+
* not a linear encoding: the vendor file states the byte but no table (the
|
|
29
|
+
* Rival 100 sensor exposes only eight hardware steps). rivalcfg's
|
|
30
|
+
* `rival100.py` supplies that table — 250→0x08, 500→0x07, 1000→0x06,
|
|
31
|
+
* 1250→0x05, 1500→0x04, 1750→0x03, 2000→0x02, 4000→0x01 (note the
|
|
32
|
+
* *inverted* byte order) — and is the sole source for the mapping, flagged
|
|
33
|
+
* here. Off-table DPI values are rejected. The active preset level is the
|
|
34
|
+
* one readable value (`16 00`).
|
|
35
|
+
*
|
|
36
|
+
* Polling (`04 00`) is write-only (1000→0x01, 500→0x02, 250→0x03,
|
|
37
|
+
* 125→0x04). Lighting is a single zone: color (`05 00` + RGB) and effect
|
|
38
|
+
* (`07 00` + mode). A firmware version (`10 00`, two bytes) is defined for
|
|
39
|
+
* the Rival 105 and the derived files; the Rival 100 base file has the same
|
|
40
|
+
* struct commented out ("removed for security reasons"), but rivalcfg reads
|
|
41
|
+
* it on the Rival 100, so it is exposed here and used by the driver as its
|
|
42
|
+
* connectivity probe (flagged).
|
|
43
|
+
*
|
|
44
|
+
* Settings apply immediately; the save command (`09 00`) persists them to
|
|
45
|
+
* onboard flash. None of this has been verified on physical hardware by
|
|
46
|
+
* this project.
|
|
47
|
+
*/
|
|
48
|
+
export declare const RIVAL100_REPORT_ID = 0;
|
|
49
|
+
/** Command prefixes; the payload is the prefix plus its arguments. */
|
|
50
|
+
export declare const RIVAL100_COMMAND: {
|
|
51
|
+
readonly sensitivity1: readonly [3, 1];
|
|
52
|
+
readonly sensitivity2: readonly [3, 2];
|
|
53
|
+
readonly pollingRate: readonly [4, 0];
|
|
54
|
+
readonly ledColor: readonly [5, 0];
|
|
55
|
+
readonly ledPulsation: readonly [7, 0];
|
|
56
|
+
readonly button6Mode: readonly [11];
|
|
57
|
+
readonly save: readonly [9, 0];
|
|
58
|
+
readonly firmware: readonly [16, 0];
|
|
59
|
+
readonly activeCpiIndex: readonly [22, 0];
|
|
60
|
+
};
|
|
61
|
+
/** `09 00` — commit the current settings to onboard flash. */
|
|
62
|
+
export declare const RIVAL100_SAVE_COMMAND: readonly [9, 0];
|
|
63
|
+
export declare const RIVAL100_FIRMWARE_RESPONSE_LENGTH = 2;
|
|
64
|
+
export declare const RIVAL100_POLLING_RATES: readonly [125, 250, 500, 1000];
|
|
65
|
+
/**
|
|
66
|
+
* The eight hardware DPI steps the Rival 100 sensor exposes, from
|
|
67
|
+
* rivalcfg's `rival100.py` `choices` (the vendor file gives no table). Note
|
|
68
|
+
* the inverted byte order: the largest DPI is the smallest byte.
|
|
69
|
+
*/
|
|
70
|
+
export declare const RIVAL100_DPI_TO_BYTE: ReadonlyMap<number, number>;
|
|
71
|
+
/** rivalcfg `rival100.py` defaults for the two presets. */
|
|
72
|
+
export declare const RIVAL100_DEFAULT_DPI_PRESET_1 = 1000;
|
|
73
|
+
export declare const RIVAL100_DEFAULT_DPI_PRESET_2 = 2000;
|
|
74
|
+
export declare const RIVAL100_DEFAULT_POLLING_RATE = 1000;
|
|
75
|
+
export declare class Rival100ProtocolError extends Error {
|
|
76
|
+
}
|
|
77
|
+
/** The eight supported DPI values, ascending. */
|
|
78
|
+
export declare function steelseriesRival100DpiOptions(): number[];
|
|
79
|
+
/** `03 01 <byte>` — sensitivity preset 1. */
|
|
80
|
+
export declare function steelseriesRival100EncodeSensitivity1(dpi: number): Uint8Array;
|
|
81
|
+
/** `03 02 <byte>` — sensitivity preset 2. */
|
|
82
|
+
export declare function steelseriesRival100EncodeSensitivity2(dpi: number): Uint8Array;
|
|
83
|
+
/** `04 00 <v>` with 1000→0x01, 500→0x02, 250→0x03, 125→0x04. */
|
|
84
|
+
export declare function steelseriesRival100EncodePollingRate(pollingRateHz: number): Uint8Array;
|
|
85
|
+
/** `09 00` — commit the current settings to onboard flash. */
|
|
86
|
+
export declare function steelseriesRival100SaveCommand(): Uint8Array;
|
|
87
|
+
/** `10 00` — the device answers with minor then major firmware bytes. */
|
|
88
|
+
export declare function steelseriesRival100FirmwareQuery(): Uint8Array;
|
|
89
|
+
/** `16 00` — read the active preset index. */
|
|
90
|
+
export declare function steelseriesRival100ActiveCpiQuery(): Uint8Array;
|
|
91
|
+
export interface SteelSeriesRival100Firmware {
|
|
92
|
+
/** The two raw response bytes, in the order the device sent them (minor, major). */
|
|
93
|
+
bytes: [number, number];
|
|
94
|
+
/** The version the two bytes describe, major first, e.g. "1.3". */
|
|
95
|
+
display: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Decode the two-byte firmware response. The specification's incoming
|
|
99
|
+
* struct orders the fields `fw_minor` then `fw_major`, so the display string
|
|
100
|
+
* puts them back in major.minor order.
|
|
101
|
+
*/
|
|
102
|
+
export declare function steelseriesRival100DecodeFirmware(payload: Uint8Array): SteelSeriesRival100Firmware;
|
|
103
|
+
/**
|
|
104
|
+
* `05 00 <r> <g> <b>` — the single LED zone color. The vendor struct also
|
|
105
|
+
* carries a `brightness` byte, but both the vendor's own color-sequencing
|
|
106
|
+
* template and rivalcfg's `rgbcolor` leave it zero, so this codec matches
|
|
107
|
+
* them rather than inventing a brightness semantic.
|
|
108
|
+
*/
|
|
109
|
+
export declare function steelseriesRival100EncodeLedColor(r: number, g: number, b: number): Uint8Array;
|
|
110
|
+
/** `07 00 <mode>` — lighting effect. See `steelseriesRival100EncodeLightEffect`. */
|
|
111
|
+
export declare const RIVAL100_LIGHT_EFFECT_TO_BYTE: {
|
|
112
|
+
readonly steady: 1;
|
|
113
|
+
readonly breath: 3;
|
|
114
|
+
};
|
|
115
|
+
export type Rival100LightEffect = keyof typeof RIVAL100_LIGHT_EFFECT_TO_BYTE;
|
|
116
|
+
/** `07 00 <mode>` — steady or breath. */
|
|
117
|
+
export declare function steelseriesRival100EncodeLightEffect(effect: Rival100LightEffect): Uint8Array;
|
|
118
|
+
/**
|
|
119
|
+
* `0B <mode>` — the button-6 (CPI) button mode. `dpi` keeps hardware DPI
|
|
120
|
+
* switching; `os` reports it as a normal OS-bound button. The Rival 100
|
|
121
|
+
* "PC Bang" edition sends an extra `00 0E 01` packet before this one (see
|
|
122
|
+
* `rival-100-pc-bang.lisp`); that quirk is handled by the driver for that
|
|
123
|
+
* product id.
|
|
124
|
+
*/
|
|
125
|
+
export declare const RIVAL100_BUTTON6_MODE_TO_BYTE: {
|
|
126
|
+
readonly dpi: 0;
|
|
127
|
+
readonly os: 1;
|
|
128
|
+
};
|
|
129
|
+
export type Rival100Button6Mode = keyof typeof RIVAL100_BUTTON6_MODE_TO_BYTE;
|
|
130
|
+
/** `0B <mode>` — dpi or os. */
|
|
131
|
+
export declare function steelseriesRival100EncodeButton6Mode(mode: Rival100Button6Mode): Uint8Array;
|
|
132
|
+
/** `00 0E 01` — the pre-packet the Rival 100 PC Bang edition sends before `0B`. */
|
|
133
|
+
export declare const RIVAL100_PC_BANG_BUTTON6_PREFIX: readonly [0, 14, 1];
|
|
134
|
+
//# sourceMappingURL=rival-100.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rival-100.d.ts","sourceRoot":"","sources":["../../src/steelseries/rival-100.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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