@openmouse/protocol 0.49.0 → 0.50.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 (83) hide show
  1. package/README.md +1 -0
  2. package/dist/drivers/atk/hid.d.ts.map +1 -1
  3. package/dist/drivers/atk/hid.js +2 -2
  4. package/dist/drivers/atk/hid.js.map +1 -1
  5. package/dist/drivers/atk/products.d.ts +7 -0
  6. package/dist/drivers/atk/products.d.ts.map +1 -1
  7. package/dist/drivers/atk/products.js +19 -2
  8. package/dist/drivers/atk/products.js.map +1 -1
  9. package/dist/drivers/gwolves/products.d.ts +5 -0
  10. package/dist/drivers/gwolves/products.d.ts.map +1 -1
  11. package/dist/drivers/gwolves/products.js +14 -10
  12. package/dist/drivers/gwolves/products.js.map +1 -1
  13. package/dist/drivers/gwolves/xvi-hid.d.ts +1 -0
  14. package/dist/drivers/gwolves/xvi-hid.d.ts.map +1 -1
  15. package/dist/drivers/gwolves/xvi-hid.js +14 -7
  16. package/dist/drivers/gwolves/xvi-hid.js.map +1 -1
  17. package/dist/drivers/hitscan/xvi-hid.d.ts +110 -0
  18. package/dist/drivers/hitscan/xvi-hid.d.ts.map +1 -0
  19. package/dist/drivers/hitscan/xvi-hid.js +803 -0
  20. package/dist/drivers/hitscan/xvi-hid.js.map +1 -0
  21. package/dist/drivers/motospeed/hid.js +1 -1
  22. package/dist/drivers/motospeed/hid.js.map +1 -1
  23. package/dist/drivers/mouse-types.d.ts +16 -0
  24. package/dist/drivers/mouse-types.d.ts.map +1 -1
  25. package/dist/drivers/razer/hid.d.ts +0 -1
  26. package/dist/drivers/razer/hid.d.ts.map +1 -1
  27. package/dist/drivers/razer/hid.js +14 -9
  28. package/dist/drivers/razer/hid.js.map +1 -1
  29. package/dist/drivers/redragon/hid.d.ts +44 -63
  30. package/dist/drivers/redragon/hid.d.ts.map +1 -1
  31. package/dist/drivers/redragon/hid.js +207 -270
  32. package/dist/drivers/redragon/hid.js.map +1 -1
  33. package/dist/drivers/registry.d.ts.map +1 -1
  34. package/dist/drivers/registry.js +6 -1
  35. package/dist/drivers/registry.js.map +1 -1
  36. package/dist/drivers/vendors.d.ts +1 -1
  37. package/dist/drivers/vendors.d.ts.map +1 -1
  38. package/dist/drivers/vendors.js +6 -4
  39. package/dist/drivers/vendors.js.map +1 -1
  40. package/dist/gearhub/index.d.ts +8 -0
  41. package/dist/gearhub/index.d.ts.map +1 -1
  42. package/dist/gearhub/index.js +18 -0
  43. package/dist/gearhub/index.js.map +1 -1
  44. package/dist/hitscan/index.d.ts +2 -0
  45. package/dist/hitscan/index.d.ts.map +1 -1
  46. package/dist/hitscan/index.js +2 -0
  47. package/dist/hitscan/index.js.map +1 -1
  48. package/dist/hitscan/xvi-inputs.d.ts +81 -0
  49. package/dist/hitscan/xvi-inputs.d.ts.map +1 -0
  50. package/dist/hitscan/xvi-inputs.js +393 -0
  51. package/dist/hitscan/xvi-inputs.js.map +1 -0
  52. package/dist/hitscan/xvi.d.ts +278 -0
  53. package/dist/hitscan/xvi.d.ts.map +1 -0
  54. package/dist/hitscan/xvi.js +773 -0
  55. package/dist/hitscan/xvi.js.map +1 -0
  56. package/dist/keychron/index.d.ts.map +1 -1
  57. package/dist/keychron/index.js +4 -0
  58. package/dist/keychron/index.js.map +1 -1
  59. package/dist/razer/codec.d.ts +3 -2
  60. package/dist/razer/codec.d.ts.map +1 -1
  61. package/dist/razer/codec.js +5 -4
  62. package/dist/razer/codec.js.map +1 -1
  63. package/dist/redragon/deprecated.d.ts +24 -0
  64. package/dist/redragon/deprecated.d.ts.map +1 -0
  65. package/dist/redragon/deprecated.js +54 -0
  66. package/dist/redragon/deprecated.js.map +1 -0
  67. package/dist/redragon/holtek.d.ts +127 -0
  68. package/dist/redragon/holtek.d.ts.map +1 -0
  69. package/dist/redragon/holtek.js +232 -0
  70. package/dist/redragon/holtek.js.map +1 -0
  71. package/dist/redragon/index.d.ts +9 -203
  72. package/dist/redragon/index.d.ts.map +1 -1
  73. package/dist/redragon/index.js +11 -430
  74. package/dist/redragon/index.js.map +1 -1
  75. package/dist/redragon/m612.d.ts +82 -0
  76. package/dist/redragon/m612.d.ts.map +1 -0
  77. package/dist/redragon/m612.js +166 -0
  78. package/dist/redragon/m612.js.map +1 -0
  79. package/dist/redragon/m724.d.ts +47 -0
  80. package/dist/redragon/m724.d.ts.map +1 -0
  81. package/dist/redragon/m724.js +107 -0
  82. package/dist/redragon/m724.js.map +1 -0
  83. package/package.json +1 -1
@@ -0,0 +1,127 @@
1
+ export declare const REDRAGON_VENDOR_ID = 1241;
2
+ export declare const REDRAGON_CONFIG_USAGE_PAGE = 65440;
3
+ export declare const REDRAGON_CONFIG_USAGE = 1;
4
+ export declare const REDRAGON_REPORT_ID = 2;
5
+ export declare const REDRAGON_REPORT_SIZE = 16;
6
+ /** First payload byte of a config write (report id excluded). */
7
+ export declare const REDRAGON_CMD_WRITE = 243;
8
+ /** First payload byte of a settings read (report id excluded). */
9
+ export declare const REDRAGON_CMD_READ = 242;
10
+ /** First payload byte of the session bracket (report id excluded). */
11
+ export declare const REDRAGON_CMD_HELLO = 245;
12
+ /** First payload byte of a commit write (report id excluded). */
13
+ export declare const REDRAGON_CMD_COMMIT = 241;
14
+ /** First payload byte of every GET_FEATURE answer (report id excluded). */
15
+ export declare const REDRAGON_REPLY_TAG = 8;
16
+ /** Length of the answer header before the data bytes (report id excluded). */
17
+ export declare const REDRAGON_REPLY_HEADER = 7;
18
+ /** Most data bytes one read or write frame carries. */
19
+ export declare const REDRAGON_MAX_TRANSFER = 8;
20
+ /** Write section of the commit block. */
21
+ export declare const REDRAGON_COMMIT_SECTION = 2;
22
+ /**
23
+ * Commit codes RDCfg sends after a button write (`SendButtonRefesh`), in
24
+ * order. Each reloads one area (01 profile, 02 DPI, 04 lighting, 08 polling
25
+ * and lift-off); a write without its commit is stored but only takes effect
26
+ * at boot. The whole block is sent after every write.
27
+ */
28
+ export declare const REDRAGON_COMMIT_CODES: readonly [4, 1, 2, 8, 16];
29
+ export declare const REDRAGON_POLLING_RATES: readonly [125, 250, 500, 1000];
30
+ /** Polling code per rate: code = 1000 / Hz. */
31
+ export declare const REDRAGON_POLLING_CODES: Readonly<Record<number, number>>;
32
+ /** `[02 F3 addrLo addrHi len 00 00 00 data...]` (full frame, report id included). */
33
+ export declare function redragonEncodeWrite(address: number, data: ArrayLike<number>): Uint8Array;
34
+ /** `[02 F2 addrLo addrHi len ...]` (full frame, report id included). */
35
+ export declare function redragonEncodeRead(address: number, length: number): Uint8Array;
36
+ /**
37
+ * Validates the GET_FEATURE answer to `redragonEncodeRead(address, length)`
38
+ * and returns its data bytes. Accepts the answer with or without the leading
39
+ * report id, since WebHID and hidraw differ there.
40
+ */
41
+ export declare function redragonDecodeRead(answer: Uint8Array, address: number, length: number): Uint8Array;
42
+ /** Session bracket frame: `[02 F5 00]` opens, `[02 F5 01]` closes. */
43
+ export declare function redragonSession(begin: boolean): Uint8Array;
44
+ /** One commit write `[02 F1 02 code]` (full frame, report id included). */
45
+ export declare function redragonEncodeCommit(code: number): Uint8Array;
46
+ export declare const REDRAGON_PROFILE_COUNT = 5;
47
+ /** Active onboard profile `[profile, 00]`, 0-4. */
48
+ export declare const REDRAGON_ACTIVE_PROFILE_ADDRESS = 44;
49
+ /** Extra commit RDCfg's MODE select sends before the commit block. */
50
+ export declare const REDRAGON_PROFILE_SELECT_CODE = 1;
51
+ /** Polling code of profile p at `0x32 + 2p`, `[1000 / Hz, 00]`. */
52
+ export declare const REDRAGON_POLL_ADDRESS = 50;
53
+ /**
54
+ * Per-profile block bases. `base + 0` is the active DPI stage (0-4); stage
55
+ * slot `n` is the 5 bytes at `base + 2 + 6n`: `[enabled, x, xRange, y, yRange]`.
56
+ */
57
+ export declare const REDRAGON_PROFILE_BASES: readonly [66, 258, 434, 610, 786];
58
+ export declare const REDRAGON_STAGE_COUNT = 5;
59
+ export declare const REDRAGON_SLOT_LENGTH = 5;
60
+ /** Button slot `s` of profile p is the 4 bytes at `button base + 4s`. */
61
+ export declare const REDRAGON_BUTTON_BASES: readonly [130, 322, 498, 674, 850];
62
+ export declare const REDRAGON_BUTTON_LENGTH = 4;
63
+ export declare function redragonPollAddress(profile: number): number;
64
+ /** Address of one DPI stage slot. */
65
+ export declare function redragonSlotAddress(profile: number, stage: number): number;
66
+ export interface RedragonDpiCode {
67
+ value: number;
68
+ range: 0 | 1;
69
+ }
70
+ /** Slider position whose label is nearest to `dpi` (ties go to the lower one). */
71
+ export declare function redragonNearestDpiPosition(labels: readonly number[], dpi: number, model: string): number;
72
+ /**
73
+ * Keyboard assignments are `[8F, modifiers, usage]` with the HID keyboard
74
+ * modifier bits (1 Ctrl, 2 Shift, 4 Alt, 8 Win) and usage IDs (RDCfg's
75
+ * COMBO KEY and shortcut menus).
76
+ */
77
+ export declare const REDRAGON_KEY_ACTION = 143;
78
+ /** RDCfg's SINGLE KEY writes `[90 00 usage 00]` instead (action table `DAT_0049f280`). */
79
+ export declare const REDRAGON_SINGLE_KEY_ACTION = 144;
80
+ export interface RedragonButtonCodec {
81
+ /** Every action name `encode` accepts, in display order. */
82
+ options: readonly string[];
83
+ /** Four-byte slot value for an action name from `options`. */
84
+ encode(action: string): number[];
85
+ /**
86
+ * Names a slot value: an offered action where the bytes match one exactly,
87
+ * any other keyboard combination by its keys, and anything else (macros,
88
+ * RDCfg's advanced actions) as its raw bytes.
89
+ */
90
+ decode(value: ArrayLike<number>): string;
91
+ }
92
+ /**
93
+ * Button codec over a model's single-action list plus the shared shortcuts
94
+ * and keys; `keyPrefix` is what a plain "Key X" writes before the usage.
95
+ */
96
+ export declare function redragonButtonCodec(model: string, actions: ReadonlyArray<readonly [string, readonly number[]]>, keyPrefix?: readonly number[]): RedragonButtonCodec;
97
+ /** What differs between the Holtek models; the memory layout above is shared. */
98
+ export interface RedragonModel {
99
+ /** Catalog model, e.g. "M724". */
100
+ model: string;
101
+ productId: number;
102
+ dpi: {
103
+ /** RDCfg slider labels, ascending. */
104
+ labels: readonly number[];
105
+ /** Step the DPI editor offers. */
106
+ step: number;
107
+ /** Snaps to the nearest label and returns it with its wire code. */
108
+ encode(dpi: number): RedragonDpiCode & {
109
+ dpi: number;
110
+ };
111
+ decode(value: number, range: number): number;
112
+ };
113
+ /** Button names and slot offsets from the profile's button base, in slot order. */
114
+ buttons: {
115
+ names: readonly string[];
116
+ offsets: readonly number[];
117
+ } & RedragonButtonCodec;
118
+ /**
119
+ * `effect`: one global effect selector plus a parameter block per effect
120
+ * (M612, RDCfg's `PRODUCT/Light=4` path). `profile`: one block per
121
+ * profile at `0x448 + 8p` (M724, `PRODUCT/Light=0`).
122
+ */
123
+ lighting: "effect" | "profile";
124
+ /** Lift-off `[level, 00]` (0 low, 1 medium, 2 high), where the mouse honours it. */
125
+ liftOffAddress?: number;
126
+ }
127
+ //# sourceMappingURL=holtek.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"holtek.d.ts","sourceRoot":"","sources":["../../src/redragon/holtek.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,OAAS,CAAC;AACzC,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,eAAO,MAAM,qBAAqB,IAAO,CAAC;AAC1C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,MAAO,CAAC;AACvC,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,MAAO,CAAC;AACtC,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,MAAO,CAAC;AACvC,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,MAAO,CAAC;AACxC,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,IAAO,CAAC;AACvC,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,yCAAyC;AACzC,eAAO,MAAM,uBAAuB,IAAO,CAA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ACvD,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9C,CAAC;IACF,mFAAmF;IACnF,OAAO,EAAE;QAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GAAG,mBAAmB,CAAC;IACxF;;;;OAIG;IACH,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,232 @@
1
+ /*
2
+ * Holtek transport shared by the Redragon M724 and M612, decoded from
3
+ * RDCfg.exe (sha256 ddfab882...7294) and confirmed on both mice: the
4
+ * settings are one flat memory behind 16-byte feature report 2 on the
5
+ * `0xFFA0:0x01` collection (USB interface 2).
6
+ *
7
+ * write [02 F3 addrLo addrHi len 00 00 00 data...] (len <= 8)
8
+ * read [02 F2 addrLo addrHi len ...], then GET_FEATURE
9
+ * -> [02 08 addrLo 32+addrHi len 00 FA FA data...]
10
+ * commit [02 F1 02 code]
11
+ * bracket [02 F5 00] ... [02 F5 01] around a write session
12
+ *
13
+ * There is no checksum. Malformed frames STALL, and a session left open
14
+ * hangs the interface until replug.
15
+ */
16
+ import { KEY_USAGES, SHORTCUTS, keyName } from "./keys.js";
17
+ export const REDRAGON_VENDOR_ID = 0x04d9; // Holtek Semiconductor
18
+ export const REDRAGON_CONFIG_USAGE_PAGE = 0xffa0;
19
+ export const REDRAGON_CONFIG_USAGE = 0x01;
20
+ export const REDRAGON_REPORT_ID = 2;
21
+ export const REDRAGON_REPORT_SIZE = 16;
22
+ /** First payload byte of a config write (report id excluded). */
23
+ export const REDRAGON_CMD_WRITE = 0xf3;
24
+ /** First payload byte of a settings read (report id excluded). */
25
+ export const REDRAGON_CMD_READ = 0xf2;
26
+ /** First payload byte of the session bracket (report id excluded). */
27
+ export const REDRAGON_CMD_HELLO = 0xf5;
28
+ /** First payload byte of a commit write (report id excluded). */
29
+ export const REDRAGON_CMD_COMMIT = 0xf1;
30
+ /** First payload byte of every GET_FEATURE answer (report id excluded). */
31
+ export const REDRAGON_REPLY_TAG = 0x08;
32
+ /** Length of the answer header before the data bytes (report id excluded). */
33
+ export const REDRAGON_REPLY_HEADER = 7;
34
+ /** Most data bytes one read or write frame carries. */
35
+ export const REDRAGON_MAX_TRANSFER = 8;
36
+ /** Write section of the commit block. */
37
+ export const REDRAGON_COMMIT_SECTION = 0x02;
38
+ /**
39
+ * Commit codes RDCfg sends after a button write (`SendButtonRefesh`), in
40
+ * order. Each reloads one area (01 profile, 02 DPI, 04 lighting, 08 polling
41
+ * and lift-off); a write without its commit is stored but only takes effect
42
+ * at boot. The whole block is sent after every write.
43
+ */
44
+ export const REDRAGON_COMMIT_CODES = [0x04, 0x01, 0x02, 0x08, 0x10];
45
+ export const REDRAGON_POLLING_RATES = [125, 250, 500, 1000];
46
+ /** Polling code per rate: code = 1000 / Hz. */
47
+ export const REDRAGON_POLLING_CODES = {
48
+ 1000: 0x01,
49
+ 500: 0x02,
50
+ 250: 0x04,
51
+ 125: 0x08,
52
+ };
53
+ /** Rejects addresses outside 16 bits and lengths a single frame cannot carry. */
54
+ function checkTransfer(address, length) {
55
+ if (!Number.isInteger(address) || address < 0 || address > 0xffff) {
56
+ throw new Error(`Redragon address ${address} is outside 0x0000-0xffff.`);
57
+ }
58
+ if (!Number.isInteger(length) || length < 1 || length > REDRAGON_MAX_TRANSFER) {
59
+ throw new Error(`Redragon transfer length ${length} is outside 1-${REDRAGON_MAX_TRANSFER}.`);
60
+ }
61
+ }
62
+ /** `[02 F3 addrLo addrHi len 00 00 00 data...]` (full frame, report id included). */
63
+ export function redragonEncodeWrite(address, data) {
64
+ checkTransfer(address, data.length);
65
+ const frame = new Uint8Array(REDRAGON_REPORT_SIZE);
66
+ frame[0] = REDRAGON_REPORT_ID;
67
+ frame[1] = REDRAGON_CMD_WRITE;
68
+ frame[2] = address & 0xff;
69
+ frame[3] = address >> 8;
70
+ frame[4] = data.length;
71
+ for (let index = 0; index < data.length; index++) {
72
+ const byte = data[index];
73
+ if (!Number.isInteger(byte) || byte < 0 || byte > 0xff)
74
+ throw new Error(`Redragon data byte ${byte} is not a byte.`);
75
+ frame[8 + index] = byte;
76
+ }
77
+ return frame;
78
+ }
79
+ /** `[02 F2 addrLo addrHi len ...]` (full frame, report id included). */
80
+ export function redragonEncodeRead(address, length) {
81
+ checkTransfer(address, length);
82
+ const frame = new Uint8Array(REDRAGON_REPORT_SIZE);
83
+ frame[0] = REDRAGON_REPORT_ID;
84
+ frame[1] = REDRAGON_CMD_READ;
85
+ frame[2] = address & 0xff;
86
+ frame[3] = address >> 8;
87
+ frame[4] = length;
88
+ return frame;
89
+ }
90
+ /**
91
+ * Validates the GET_FEATURE answer to `redragonEncodeRead(address, length)`
92
+ * and returns its data bytes. Accepts the answer with or without the leading
93
+ * report id, since WebHID and hidraw differ there.
94
+ */
95
+ export function redragonDecodeRead(answer, address, length) {
96
+ checkTransfer(address, length);
97
+ const body = answer[0] === REDRAGON_REPORT_ID && answer[1] === REDRAGON_REPLY_TAG ? answer.subarray(1) : answer;
98
+ const hex = [...answer].map((byte) => byte.toString(16).padStart(2, "0")).join(" ");
99
+ if (body.length < REDRAGON_REPLY_HEADER + length ||
100
+ body[0] !== REDRAGON_REPLY_TAG ||
101
+ body[1] !== (address & 0xff) ||
102
+ body[2] !== 0x32 + (address >> 8) ||
103
+ body[3] !== length ||
104
+ body[5] !== 0xfa ||
105
+ body[6] !== 0xfa) {
106
+ throw new Error(`Redragon read of ${length} bytes at 0x${address.toString(16).padStart(4, "0")} got an unexpected answer: ${hex}.`);
107
+ }
108
+ return body.slice(REDRAGON_REPLY_HEADER, REDRAGON_REPLY_HEADER + length);
109
+ }
110
+ /** Session bracket frame: `[02 F5 00]` opens, `[02 F5 01]` closes. */
111
+ export function redragonSession(begin) {
112
+ const frame = new Uint8Array(REDRAGON_REPORT_SIZE);
113
+ frame[0] = REDRAGON_REPORT_ID;
114
+ frame[1] = REDRAGON_CMD_HELLO;
115
+ frame[2] = begin ? 0x00 : 0x01;
116
+ return frame;
117
+ }
118
+ /** One commit write `[02 F1 02 code]` (full frame, report id included). */
119
+ export function redragonEncodeCommit(code) {
120
+ const frame = new Uint8Array(REDRAGON_REPORT_SIZE);
121
+ frame[0] = REDRAGON_REPORT_ID;
122
+ frame[1] = REDRAGON_CMD_COMMIT;
123
+ frame[2] = REDRAGON_COMMIT_SECTION;
124
+ frame[3] = code;
125
+ return frame;
126
+ }
127
+ /*
128
+ * Settings memory layout, identical on the M724 and M612 (RDCfg's
129
+ * `SendPollRate`, `SendLedState`, profile select, DPI and button writers
130
+ * are model-independent; only the codecs below differ).
131
+ */
132
+ export const REDRAGON_PROFILE_COUNT = 5;
133
+ /** Active onboard profile `[profile, 00]`, 0-4. */
134
+ export const REDRAGON_ACTIVE_PROFILE_ADDRESS = 0x002c;
135
+ /** Extra commit RDCfg's MODE select sends before the commit block. */
136
+ export const REDRAGON_PROFILE_SELECT_CODE = 0x01;
137
+ /** Polling code of profile p at `0x32 + 2p`, `[1000 / Hz, 00]`. */
138
+ export const REDRAGON_POLL_ADDRESS = 0x0032;
139
+ /**
140
+ * Per-profile block bases. `base + 0` is the active DPI stage (0-4); stage
141
+ * slot `n` is the 5 bytes at `base + 2 + 6n`: `[enabled, x, xRange, y, yRange]`.
142
+ */
143
+ export const REDRAGON_PROFILE_BASES = [0x0042, 0x0102, 0x01b2, 0x0262, 0x0312];
144
+ export const REDRAGON_STAGE_COUNT = 5;
145
+ export const REDRAGON_SLOT_LENGTH = 5;
146
+ /** Button slot `s` of profile p is the 4 bytes at `button base + 4s`. */
147
+ export const REDRAGON_BUTTON_BASES = [0x0082, 0x0142, 0x01f2, 0x02a2, 0x0352];
148
+ export const REDRAGON_BUTTON_LENGTH = 4;
149
+ export function redragonPollAddress(profile) {
150
+ checkProfile(profile);
151
+ return REDRAGON_POLL_ADDRESS + 2 * profile;
152
+ }
153
+ /** Address of one DPI stage slot. */
154
+ export function redragonSlotAddress(profile, stage) {
155
+ checkProfile(profile);
156
+ if (!Number.isInteger(stage) || stage < 0 || stage >= REDRAGON_STAGE_COUNT) {
157
+ throw new Error(`Redragon DPI stage ${stage} is outside 0-${REDRAGON_STAGE_COUNT - 1}.`);
158
+ }
159
+ return REDRAGON_PROFILE_BASES[profile] + 2 + 6 * stage;
160
+ }
161
+ /** Rejects profile indexes outside 0-4. */
162
+ function checkProfile(profile) {
163
+ if (!Number.isInteger(profile) || profile < 0 || profile >= REDRAGON_PROFILE_COUNT) {
164
+ throw new Error(`Redragon profile ${profile} is outside 0-${REDRAGON_PROFILE_COUNT - 1}.`);
165
+ }
166
+ }
167
+ /** Slider position whose label is nearest to `dpi` (ties go to the lower one). */
168
+ export function redragonNearestDpiPosition(labels, dpi, model) {
169
+ if (!Number.isInteger(dpi) || dpi < labels[0] || dpi > labels[labels.length - 1]) {
170
+ throw new Error(`Redragon ${model} DPI ${dpi} is outside ${labels[0]}-${labels[labels.length - 1]}.`);
171
+ }
172
+ let best = 0;
173
+ for (let position = 1; position < labels.length; position++) {
174
+ if (Math.abs(labels[position] - dpi) < Math.abs(labels[best] - dpi))
175
+ best = position;
176
+ }
177
+ return best;
178
+ }
179
+ /**
180
+ * Keyboard assignments are `[8F, modifiers, usage]` with the HID keyboard
181
+ * modifier bits (1 Ctrl, 2 Shift, 4 Alt, 8 Win) and usage IDs (RDCfg's
182
+ * COMBO KEY and shortcut menus).
183
+ */
184
+ export const REDRAGON_KEY_ACTION = 0x8f;
185
+ /** RDCfg's SINGLE KEY writes `[90 00 usage 00]` instead (action table `DAT_0049f280`). */
186
+ export const REDRAGON_SINGLE_KEY_ACTION = 0x90;
187
+ /**
188
+ * Button codec over a model's single-action list plus the shared shortcuts
189
+ * and keys; `keyPrefix` is what a plain "Key X" writes before the usage.
190
+ */
191
+ export function redragonButtonCodec(model, actions, keyPrefix = [REDRAGON_KEY_ACTION, 0x00]) {
192
+ const usage = (key) => KEY_USAGES.find(([name]) => name === key)[1];
193
+ const shortcutName = ([name, modifiers, key]) => `${name} (${keyName(modifiers, usage(key))})`;
194
+ const options = [
195
+ ...actions.map(([name]) => name),
196
+ ...SHORTCUTS.map(shortcutName),
197
+ ...KEY_USAGES.map(([name]) => `Key ${name}`),
198
+ ];
199
+ const pad = (bytes) => [...bytes, 0, 0, 0, 0].slice(0, REDRAGON_BUTTON_LENGTH);
200
+ const encode = (action) => {
201
+ const fixed = actions.find(([name]) => name === action);
202
+ if (fixed)
203
+ return pad(fixed[1]);
204
+ const shortcut = SHORTCUTS.find((entry) => shortcutName(entry) === action);
205
+ if (shortcut)
206
+ return pad([REDRAGON_KEY_ACTION, shortcut[1], usage(shortcut[2])]);
207
+ const key = action.startsWith("Key ") ? KEY_USAGES.find(([name]) => name === action.slice(4)) : undefined;
208
+ if (key)
209
+ return pad([...keyPrefix, key[1]]);
210
+ throw new Error(`Redragon ${model} button action "${action}" is not offered.`);
211
+ };
212
+ const decode = (value) => {
213
+ const bytes = Array.from(value).slice(0, REDRAGON_BUTTON_LENGTH);
214
+ const same = (encoded) => encoded.every((byte, index) => byte === (bytes[index] ?? 0));
215
+ const named = options.find((option) => same(encode(option)));
216
+ if (named)
217
+ return named;
218
+ if (bytes[0] === REDRAGON_KEY_ACTION && (bytes[3] ?? 0) === 0) {
219
+ const combination = keyName(bytes[1] ?? 0, bytes[2] ?? 0);
220
+ if (combination)
221
+ return `Keys ${combination}`;
222
+ }
223
+ if (bytes[0] === REDRAGON_SINGLE_KEY_ACTION && (bytes[1] ?? 0) === 0 && (bytes[3] ?? 0) === 0) {
224
+ const key = KEY_USAGES.find(([, code]) => code === bytes[2]);
225
+ if (key)
226
+ return `Key ${key[0]}`;
227
+ }
228
+ return `Vendor action (${bytes.map((byte) => byte.toString(16).padStart(2, "0")).join(" ")})`;
229
+ };
230
+ return { options, encode, decode };
231
+ }
232
+ //# sourceMappingURL=holtek.js.map
@@ -0,0 +1 @@
1
+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/** True only after the exact PID and path were exercised on hardware. */
6
7
  verified: boolean;
7
- /** Onboard DPI stages (levels) the vendor app pushes as one table. */
8
+ /** Onboard DPI stages per profile. */
8
9
  stages: number;
9
- /** Highest DPI value observed on the wire for this product. */
10
+ /** Highest DPI RDCfg's slider offers for this product. */
10
11
  maxDpi: number;
11
12
  }
12
- export declare const REDRAGON_VENDOR_ID = 1241;
13
- export declare const REDRAGON_CONFIG_USAGE_PAGE = 65440;
14
- export declare const REDRAGON_CONFIG_USAGE = 1;
15
- export declare const REDRAGON_REPORT_ID = 2;
16
- export declare const REDRAGON_REPORT_SIZE = 16;
17
- /** First payload byte of a config write (report id excluded). */
18
- export declare const REDRAGON_CMD_WRITE = 243;
19
- /** Vendor hello, sent once per RDCfg session before any write. */
20
- export declare const REDRAGON_CMD_HELLO = 245;
21
- /** Write section carrying the per-profile DPI table. */
22
- export declare const REDRAGON_DPI_SECTION = 5;
23
- /** Profile index byte for profile 1 (the only profile decoded so far). */
24
- export declare const REDRAGON_PROFILE0 = 0;
25
- /**
26
- * DPI-table subcommands for profile 1, levels 1-5. Other profiles use
27
- * different bases (0x04, 0xb4, 0x64, 0x14 + 6 per level); only profile 1 is
28
- * captured well enough to send.
29
- */
30
- export declare const REDRAGON_PROFILE0_DPI_SUBCMDS: readonly [68, 74, 80, 86, 92];
31
13
  export declare const REDRAGON_PRODUCTS: ReadonlyMap<number, RedragonProduct>;
32
14
  export declare const REDRAGON_PRODUCT_IDS: readonly number[];
33
- /**
34
- * Wire encoding of one DPI axis, derived from a usbmon capture of RDCfg
35
- * pushing the table and one live 800 -> 1200 DPI edit (see
36
- * docs/redragon-m724-testing.md):
37
- *
38
- * code = round(dpi * 9 / 400) (800->18, 1200->27, 2400->54,
39
- * 3500->79, 5500->124)
40
- * code > 255 wraps to a second range: flag = 1, code = round(code / 2)
41
- * (12400->279->140)
42
- */
43
- export declare function redragonEncodeDpiValue(dpi: number): {
44
- value: number;
45
- range: 0 | 1;
46
- };
47
- /** Nominal DPI for a wire (value, range) pair. Quantization error is normal. */
48
- export declare function redragonDecodeDpiValue(value: number, range: 0 | 1): number;
49
- /**
50
- * Encodes one DPI-table write as the full 16-byte feature frame, report id
51
- * included, byte-for-byte as RDCfg sends it:
52
- *
53
- * [02 F3 sub profile 05 00 00 00 01 x range y range 00 00 00]
54
- *
55
- * X and Y carry the same value; the vendor app keeps the axes linked.
56
- */
57
- export declare function redragonEncodeDpiSlot(profile: number, level: number, dpiX: number, dpiY?: number): Uint8Array;
58
- /** First payload byte of a commit write (report id excluded). */
59
- export declare const REDRAGON_CMD_COMMIT = 241;
60
- /** Write section carrying the polling rate. */
61
- export declare const REDRAGON_POLL_SECTION = 6;
62
- /** Polling-rate subcommand. */
63
- export declare const REDRAGON_POLL_SUB = 50;
64
- /** Polling rates observed on the wire. */
65
- export declare const REDRAGON_POLLING_RATES: readonly [125, 250, 500, 1000];
66
- /** Wire code per polling rate: rate = 1000 / code (bisected live). */
67
- export declare const REDRAGON_POLLING_CODES: Readonly<Record<number, number>>;
68
- /** Write section of the commit block (meaning of the codes is unknown). */
69
- export declare const REDRAGON_COMMIT_SECTION = 2;
70
- /**
71
- * Commit codes closing every vendor session, in order. Bisected live on
72
- * hardware: without them a DPI write is stored but only takes effect at
73
- * boot; with them it applies instantly. Per-code semantics unknown.
74
- */
75
- export declare const REDRAGON_COMMIT_CODES: readonly [4, 1, 2, 8, 16];
76
- /** Vendor hello frame, sent once after connect before the first write. */
77
- export declare function redragonHello(): Uint8Array;
78
- /**
79
- * Session bracket frames. Every RDCfg session opens with `[02 F5 00 ...]`
80
- * and closes with `[02 F5 01 ...]`; a session left open hangs the mouse
81
- * interface until replug, so every write must be followed by the close.
82
- */
83
- export declare function redragonSession(begin: boolean): Uint8Array;
84
- /** One commit-block write (full frame, report id included). */
85
- export declare function redragonEncodeCommit(code: number): Uint8Array;
86
- /**
87
- * Polling-rate write (full frame, report id included), byte-for-byte as
88
- * RDCfg sends it: `[02 F3 32 00 06 00 00 00 RR 00 01 00 01 00 00 00]`
89
- * with `RR = 1000 / Hz` (captured across 4 sessions and bisected live:
90
- * 1000->0x01, 500->0x02, 250->0x04, 125->0x08).
91
- */
92
- export declare function redragonEncodePollingRate(hz: number): Uint8Array;
93
- export declare const REDRAGON_M612_PRODUCT_ID = 64609;
94
- /** First payload byte of a settings read (report id excluded). */
95
- export declare const REDRAGON_CMD_READ = 242;
96
- /** First payload byte of every GET_FEATURE answer (report id excluded). */
97
- export declare const REDRAGON_REPLY_TAG = 8;
98
- /** Length of the answer header before the data bytes (report id excluded). */
99
- export declare const REDRAGON_REPLY_HEADER = 7;
100
- /** Most data bytes one read or write frame carries. */
101
- export declare const REDRAGON_MAX_TRANSFER = 8;
102
- /** Active onboard profile, 0-4. */
103
- export declare const REDRAGON_M612_ACTIVE_PROFILE_ADDRESS = 44;
104
- /** Polling block: `[1000 / Hz, 00, 02, 00, 02, 00]` (last four constant). */
105
- export declare const REDRAGON_M612_POLL_ADDRESS = 50;
106
- export declare const REDRAGON_M612_POLL_LENGTH = 6;
107
- /**
108
- * Per-profile block bases. `base + 0` is the active DPI stage (0-4, moved
109
- * by the DPI button); stage slot `n` is the 5 bytes at `base + 2 + 6n`:
110
- * `[enabled, x, xRange, y, yRange]`.
111
- */
112
- export declare const REDRAGON_M612_PROFILE_BASES: readonly [66, 258, 434, 610, 786];
113
- export declare const REDRAGON_M612_STAGE_COUNT = 5;
114
- export declare const REDRAGON_M612_SLOT_LENGTH = 5;
115
- /**
116
- * DPI labels RDCfg shows for each position of its DPI slider, read from the
117
- * running vendor app and cross-checked by matching its bitmap-font glyphs.
118
- * Position `p` 0-92 writes `value = 14 + p, range 0`; 93-145 write
119
- * `value = p - 39, range 1` (range 1 doubles the step). The rule was
120
- * confirmed by Apply captures at positions 0-6, 93, 94, 120, 144, and 145,
121
- * and by the factory push (13, 39, 65, 92). The labels are the vendor's
122
- * rounded values, so they are the DPI OpenMouse shows for the same bytes.
123
- */
124
- export declare const REDRAGON_M612_DPI_LABELS: readonly number[];
125
- export interface RedragonDpiCode {
126
- value: number;
127
- range: 0 | 1;
128
- }
129
- /** Wire code for one RDCfg slider position. */
130
- export declare function redragonM612DpiCodeAt(position: number): RedragonDpiCode;
131
- /**
132
- * Snaps a requested DPI to the nearest RDCfg slider label (ties go to the
133
- * lower one) and returns that label with its wire code.
134
- */
135
- export declare function redragonM612EncodeDpi(dpi: number): RedragonDpiCode & {
136
- dpi: number;
137
- };
138
- /**
139
- * DPI for a wire code. Codes RDCfg can write map to its label; anything else
140
- * (another tool's write) falls back to the linear sensor scale the labels
141
- * approximate, 4000 DPI per 106 counts, rounded to 10.
142
- */
143
- export declare function redragonM612DecodeDpi(value: number, range: number): number;
144
- /** `[02 F3 addrLo addrHi len 00 00 00 data...]` (full frame, report id included). */
145
- export declare function redragonEncodeWrite(address: number, data: ArrayLike<number>): Uint8Array;
146
- /** `[02 F2 addrLo addrHi len ...]` (full frame, report id included). */
147
- export declare function redragonEncodeRead(address: number, length: number): Uint8Array;
148
- /**
149
- * Validates the GET_FEATURE answer to `redragonEncodeRead(address, length)`
150
- * and returns its data bytes. Accepts the answer with or without the leading
151
- * report id, since WebHID and hidraw differ there.
152
- */
153
- export declare function redragonDecodeRead(answer: Uint8Array, address: number, length: number): Uint8Array;
154
- /** Address of one M612 DPI stage slot. */
155
- export declare function redragonM612SlotAddress(profile: number, stage: number): number;
156
- export declare const REDRAGON_M612_PROFILE_COUNT = 5;
157
- /**
158
- * RDCfg's MODE select, byte-for-byte: write `[profile, 00]` at `0x2c`
159
- * (outside any `F5` bracket), then `F1 02 01`, then the commit block.
160
- */
161
- export declare const REDRAGON_M612_PROFILE_SELECT_CODE = 1;
162
- /** Lighting effect selector: one bit per effect, `[bit, 00]`. Global, not per profile. */
163
- export declare const REDRAGON_M612_LIGHTING_EFFECT_ADDRESS = 1094;
164
- export type RedragonM612Effect = "wave" | "spectrumBreathing" | "breathing" | "flash" | "static" | "off";
165
- export interface RedragonM612EffectInfo {
166
- effect: RedragonM612Effect;
167
- /** Value at `0x446`. */
168
- bit: number;
169
- /** 8-byte parameter block `[flag, R, G, B, kind, speed, ?, brightness]`, or null for off. */
170
- block: number | null;
171
- color: boolean;
172
- speed: boolean;
173
- }
174
- /** RDCfg effects, from Apply captures of each one. */
175
- export declare const REDRAGON_M612_EFFECTS: readonly RedragonM612EffectInfo[];
176
- export declare const REDRAGON_M612_LIGHTING_BLOCK_LENGTH = 8;
177
- /** Speed byte: 8 is RDCfg's slowest slider position, 1 its fastest. */
178
- export declare const REDRAGON_M612_LIGHTING_SPEEDS = 8;
179
- /** Brightness byte: RDCfg's slider has three positions, 1-3. */
180
- export declare const REDRAGON_M612_LIGHTING_BRIGHTNESS_LEVELS = 3;
181
- export declare function redragonM612EffectForBit(bit: number): RedragonM612EffectInfo | undefined;
182
- /**
183
- * Button slots per profile, in RDCfg's numbering: 1 left, 2 right,
184
- * 3 middle, 4 rapid fire, 5-6 side, 7-8 DPI, 9 LED, then wheel up/down.
185
- * Four bytes each; there is no slot at `base + 0x24`.
186
- */
187
- export declare const REDRAGON_M612_BUTTON_BASES: readonly [130, 322, 498, 674, 850];
188
- export declare const REDRAGON_M612_BUTTON_OFFSETS: readonly [0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 44];
189
- export declare const REDRAGON_M612_BUTTON_LENGTH = 4;
190
- export declare function redragonM612ButtonAddress(profile: number, slot: number): number;
191
- /**
192
- * Single-byte actions captured from RDCfg (the value is padded to four bytes
193
- * with zeros). "Rapid fire" is button 4's factory value; its speed and count
194
- * bytes are kept exactly as shipped.
195
- */
196
- export declare const REDRAGON_M612_BUTTON_ACTIONS: ReadonlyArray<readonly [string, readonly number[]]>;
197
- /**
198
- * Keyboard assignments are `[8F, modifiers, usage]` with the HID keyboard
199
- * modifier bits (1 Ctrl, 2 Shift, 4 Alt, 8 Win) and usage IDs. Captured from
200
- * RDCfg's shortcut menus: Ctrl+V `8f 01 19`, Ctrl+A `8f 01 04`, Ctrl+F
201
- * `8f 01 09`, Ctrl+N `8f 01 11`, Alt+Tab `8f 04 2b`, Alt+F4 `8f 04 3d`,
202
- * Win+E `8f 08 08`, Win+R `8f 08 15`, Win+D `8f 08 07`, Win+L `8f 08 0f`.
203
- */
204
- export declare const REDRAGON_M612_KEY_ACTION = 143;
205
- /** Every action name `redragonM612EncodeButtonAction` accepts, in display order. */
206
- export declare const REDRAGON_M612_BUTTON_OPTIONS: readonly string[];
207
- /** Four-byte slot value for an action name from `REDRAGON_M612_BUTTON_OPTIONS`. */
208
- export declare function redragonM612EncodeButtonAction(action: string): number[];
209
- /**
210
- * Names a slot value: an offered action where the bytes match one exactly,
211
- * any other keyboard combination by its keys, and anything else (macros,
212
- * RDCfg's advanced actions) as its raw bytes.
213
- */
214
- export declare function redragonM612DecodeButtonAction(value: ArrayLike<number>): string;
15
+ /** Codec differences per Holtek PID. */
16
+ export declare const REDRAGON_MODELS: ReadonlyMap<number, RedragonModel>;
17
+ export * from "./holtek.js";
18
+ export * from "./m612.js";
19
+ export * from "./m724.js";
20
+ export * from "./deprecated.js";
215
21
  export * from "./m690-pro.js";
216
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/redragon/index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,OAAS,CAAC;AACzC,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,eAAO,MAAM,qBAAqB,IAAO,CAAC;AAC1C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,KAAK,CAAC;A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