@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.
- package/README.md +1 -0
- package/dist/drivers/atk/hid.d.ts.map +1 -1
- package/dist/drivers/atk/hid.js +2 -2
- package/dist/drivers/atk/hid.js.map +1 -1
- package/dist/drivers/atk/products.d.ts +7 -0
- package/dist/drivers/atk/products.d.ts.map +1 -1
- package/dist/drivers/atk/products.js +19 -2
- package/dist/drivers/atk/products.js.map +1 -1
- package/dist/drivers/gwolves/products.d.ts +5 -0
- package/dist/drivers/gwolves/products.d.ts.map +1 -1
- package/dist/drivers/gwolves/products.js +14 -10
- package/dist/drivers/gwolves/products.js.map +1 -1
- package/dist/drivers/gwolves/xvi-hid.d.ts +1 -0
- package/dist/drivers/gwolves/xvi-hid.d.ts.map +1 -1
- package/dist/drivers/gwolves/xvi-hid.js +14 -7
- package/dist/drivers/gwolves/xvi-hid.js.map +1 -1
- package/dist/drivers/hitscan/xvi-hid.d.ts +110 -0
- package/dist/drivers/hitscan/xvi-hid.d.ts.map +1 -0
- package/dist/drivers/hitscan/xvi-hid.js +803 -0
- package/dist/drivers/hitscan/xvi-hid.js.map +1 -0
- package/dist/drivers/motospeed/hid.js +1 -1
- package/dist/drivers/motospeed/hid.js.map +1 -1
- package/dist/drivers/mouse-types.d.ts +16 -0
- package/dist/drivers/mouse-types.d.ts.map +1 -1
- package/dist/drivers/razer/hid.d.ts +0 -1
- package/dist/drivers/razer/hid.d.ts.map +1 -1
- package/dist/drivers/razer/hid.js +14 -9
- package/dist/drivers/razer/hid.js.map +1 -1
- package/dist/drivers/redragon/hid.d.ts +44 -63
- package/dist/drivers/redragon/hid.d.ts.map +1 -1
- package/dist/drivers/redragon/hid.js +207 -270
- package/dist/drivers/redragon/hid.js.map +1 -1
- package/dist/drivers/registry.d.ts.map +1 -1
- package/dist/drivers/registry.js +6 -1
- package/dist/drivers/registry.js.map +1 -1
- package/dist/drivers/vendors.d.ts +1 -1
- package/dist/drivers/vendors.d.ts.map +1 -1
- package/dist/drivers/vendors.js +6 -4
- package/dist/drivers/vendors.js.map +1 -1
- package/dist/gearhub/index.d.ts +8 -0
- package/dist/gearhub/index.d.ts.map +1 -1
- package/dist/gearhub/index.js +18 -0
- package/dist/gearhub/index.js.map +1 -1
- package/dist/hitscan/index.d.ts +2 -0
- package/dist/hitscan/index.d.ts.map +1 -1
- package/dist/hitscan/index.js +2 -0
- package/dist/hitscan/index.js.map +1 -1
- package/dist/hitscan/xvi-inputs.d.ts +81 -0
- package/dist/hitscan/xvi-inputs.d.ts.map +1 -0
- package/dist/hitscan/xvi-inputs.js +393 -0
- package/dist/hitscan/xvi-inputs.js.map +1 -0
- package/dist/hitscan/xvi.d.ts +278 -0
- package/dist/hitscan/xvi.d.ts.map +1 -0
- package/dist/hitscan/xvi.js +773 -0
- package/dist/hitscan/xvi.js.map +1 -0
- package/dist/keychron/index.d.ts.map +1 -1
- package/dist/keychron/index.js +4 -0
- package/dist/keychron/index.js.map +1 -1
- package/dist/razer/codec.d.ts +3 -2
- package/dist/razer/codec.d.ts.map +1 -1
- package/dist/razer/codec.js +5 -4
- package/dist/razer/codec.js.map +1 -1
- package/dist/redragon/deprecated.d.ts +24 -0
- package/dist/redragon/deprecated.d.ts.map +1 -0
- package/dist/redragon/deprecated.js +54 -0
- package/dist/redragon/deprecated.js.map +1 -0
- package/dist/redragon/holtek.d.ts +127 -0
- package/dist/redragon/holtek.d.ts.map +1 -0
- package/dist/redragon/holtek.js +232 -0
- package/dist/redragon/holtek.js.map +1 -0
- package/dist/redragon/index.d.ts +9 -203
- package/dist/redragon/index.d.ts.map +1 -1
- package/dist/redragon/index.js +11 -430
- package/dist/redragon/index.js.map +1 -1
- package/dist/redragon/m612.d.ts +82 -0
- package/dist/redragon/m612.d.ts.map +1 -0
- package/dist/redragon/m612.js +166 -0
- package/dist/redragon/m612.js.map +1 -0
- package/dist/redragon/m724.d.ts +47 -0
- package/dist/redragon/m724.d.ts.map +1 -0
- package/dist/redragon/m724.js +107 -0
- package/dist/redragon/m724.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,73 +1,30 @@
|
|
|
1
1
|
import type { MouseLighting, MouseStatus } from "../mouse-types.js";
|
|
2
|
+
declare const LIFT_OFF_LEVELS: readonly ["Low", "Medium", "High"];
|
|
3
|
+
type LiftOff = (typeof LIFT_OFF_LEVELS)[number];
|
|
2
4
|
/**
|
|
3
|
-
* Redragon K1NG 1K
|
|
5
|
+
* Redragon Holtek mice (K1NG 1K M724 `04d9:fc7a`, Predator M612 `04d9:fc61`)
|
|
6
|
+
* over WebHID.
|
|
4
7
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* therefore reports this session's last-written stages (or the factory
|
|
12
|
-
* table before any write) with `valuesVerified: false`, and the only
|
|
13
|
-
* hardware probe is the `FA FA` marker every `GET_FEATURE` echo carries.
|
|
8
|
+
* Both keep their settings in one flat memory on the `0xFFA0:0x01`
|
|
9
|
+
* collection (see `@openmouse/protocol/redragon`): every value shown is
|
|
10
|
+
* read from the mouse with `F2`, and every write runs inside the vendor
|
|
11
|
+
* bracket, is followed by the commit block, and is read back before it is
|
|
12
|
+
* reported as done. DPI stages, polling, buttons, and (on the M724)
|
|
13
|
+
* lighting live per onboard profile, so they follow the active profile.
|
|
14
14
|
*/
|
|
15
15
|
export declare class RedragonHidClient {
|
|
16
16
|
readonly device: HIDDevice;
|
|
17
|
+
private readonly model;
|
|
17
18
|
private queue;
|
|
18
|
-
|
|
19
|
-
private lastPollingHz;
|
|
19
|
+
/** Throws for a PID without a model descriptor; `isSupported` filters those out first. */
|
|
20
20
|
constructor(device: HIDDevice);
|
|
21
|
+
/** Holtek VID, a catalogued PID, and the config collection (the mouse and keyboard interfaces lack it). */
|
|
21
22
|
static isSupported(device: HIDDevice): boolean;
|
|
22
23
|
get supportedPollingRates(): number[];
|
|
23
24
|
getDpiOptions(): number[];
|
|
24
25
|
open(): Promise<void>;
|
|
25
26
|
close(): Promise<void>;
|
|
26
27
|
readStatus(): Promise<MouseStatus>;
|
|
27
|
-
/**
|
|
28
|
-
* Writes the whole profile-1 DPI table in one vendor session bracket,
|
|
29
|
-
* closed by the commit block. Bisected live: RDCfg re-pushes the table on
|
|
30
|
-
* every Apply and the change is felt immediately; a lone slot write is
|
|
31
|
-
* stored but only takes effect at boot, and the trailing `F1` block is
|
|
32
|
-
* what activates it. Sibling stages come from this session's cache
|
|
33
|
-
* (factory table before any write): editing in RDCfg meanwhile makes the
|
|
34
|
-
* cache stale, exactly like any write-only driver.
|
|
35
|
-
*/
|
|
36
|
-
setDpiStageValue(stage: number, dpi: number): Promise<number>;
|
|
37
|
-
/**
|
|
38
|
-
* Writes the polling rate inside the same session bracket + commit block
|
|
39
|
-
* as DPI writes (the vendor sends it mid-push; the trailing `F1` block is
|
|
40
|
-
* what activates writes, verified live for DPI).
|
|
41
|
-
*/
|
|
42
|
-
setPollingRate(hz: number): Promise<number>;
|
|
43
|
-
/**
|
|
44
|
-
* The `FA FA` echo every `GET_FEATURE` carries doubles as the proof that
|
|
45
|
-
* the granted interface is the config channel: the mouse and keyboard
|
|
46
|
-
* interfaces expose no feature report 2 at all. The marker is matched as
|
|
47
|
-
* the last two payload bytes so both WebHID framings (report id stripped
|
|
48
|
-
* or kept) validate.
|
|
49
|
-
*/
|
|
50
|
-
protected probeConfigChannel(): Promise<void>;
|
|
51
|
-
protected sendFrame(frame: Uint8Array): Promise<void>;
|
|
52
|
-
private sendSessionFrame;
|
|
53
|
-
protected writeSession(operation: () => Promise<void>): Promise<void>;
|
|
54
|
-
protected run<T>(operation: () => Promise<T>): Promise<T>;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Redragon Predator M612 (`04d9:fc61`) WebHID control.
|
|
58
|
-
*
|
|
59
|
-
* Same Holtek transport as the M724, but the M612 answers `F2` reads (see
|
|
60
|
-
* `redragonEncodeRead`), so every value shown is read from the mouse and
|
|
61
|
-
* every write is read back before it is reported as done. Reads need no
|
|
62
|
-
* session bracket; writes use the vendor bracket and commit block.
|
|
63
|
-
*
|
|
64
|
-
* DPI stages live per onboard profile, so writes target whichever profile
|
|
65
|
-
* the mouse reports as active. DPI values snap to the positions RDCfg's
|
|
66
|
-
* slider offers and report its label for them.
|
|
67
|
-
*/
|
|
68
|
-
export declare class RedragonM612HidClient extends RedragonHidClient {
|
|
69
|
-
getDpiOptions(): number[];
|
|
70
|
-
readStatus(): Promise<MouseStatus>;
|
|
71
28
|
/**
|
|
72
29
|
* Rewrites one stage slot of the active profile, keeping its enabled byte,
|
|
73
30
|
* then reads it back. Returns the DPI label the mouse now holds, which
|
|
@@ -76,9 +33,13 @@ export declare class RedragonM612HidClient extends RedragonHidClient {
|
|
|
76
33
|
setDpiStageValue(stage: number, dpi: number): Promise<number>;
|
|
77
34
|
/** Selects the active DPI stage of the active profile, as the DPI button does. */
|
|
78
35
|
setActiveDpiStage(stage: number): Promise<number>;
|
|
79
|
-
/** Rewrites the polling code, keeping the
|
|
36
|
+
/** Rewrites the active profile's polling code, keeping the byte after it. */
|
|
80
37
|
setPollingRate(hz: number): Promise<number>;
|
|
81
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Switches the onboard profile (1-5) as RDCfg's MODE menu does: the profile
|
|
40
|
+
* byte outside any bracket, `F1 02 01`, then the commit block. Without the
|
|
41
|
+
* block the M724 stores the byte but keeps the old profile running.
|
|
42
|
+
*/
|
|
82
43
|
setProfile(profile: number): Promise<void>;
|
|
83
44
|
/**
|
|
84
45
|
* Assigns an action from `buttonOptions` to one button of the active
|
|
@@ -86,22 +47,42 @@ export declare class RedragonM612HidClient extends RedragonHidClient {
|
|
|
86
47
|
* leave the mouse unable to click.
|
|
87
48
|
*/
|
|
88
49
|
setButtonMapping(button: string, action: string): Promise<void>;
|
|
50
|
+
/** Sets the lift-off height (M724 only): Low, Medium, or High. */
|
|
51
|
+
setLiftOffDistance(value: LiftOff): Promise<LiftOff>;
|
|
89
52
|
/**
|
|
90
|
-
* Writes the
|
|
91
|
-
*
|
|
92
|
-
* the current effect shows is treated as unchanged, so switching
|
|
93
|
-
* keeps the target effect's own stored values.
|
|
53
|
+
* Writes the lighting. On the M612 that is the global effect selector and
|
|
54
|
+
* that effect's parameter block, where a colour, speed, or brightness equal
|
|
55
|
+
* to what the current effect shows is treated as unchanged, so switching
|
|
56
|
+
* effects keeps the target effect's own stored values. On the M724 it is
|
|
57
|
+
* the active profile's single block.
|
|
94
58
|
*/
|
|
95
59
|
setLighting(lighting: MouseLighting): Promise<void>;
|
|
60
|
+
/** Names every button of `profile` with its decoded action, from one ranged read. */
|
|
96
61
|
private readButtonMappings;
|
|
97
|
-
|
|
62
|
+
/** M724: the profile's block; brightness is hidden when the effect is Off. */
|
|
63
|
+
private readProfileLighting;
|
|
64
|
+
/** M612: the global effect bit and that effect's parameter block (none for Off). */
|
|
65
|
+
private readEffectLighting;
|
|
66
|
+
/** Null on models without lift-off, or for a level byte outside 0-2. */
|
|
67
|
+
private readLiftOff;
|
|
68
|
+
/** Reads any length in transfers of at most 8 bytes. */
|
|
98
69
|
private readRange;
|
|
70
|
+
/** Active profile, its stage table and active stage, and its polling rate; rejects values the firmware never holds. */
|
|
99
71
|
private readSettings;
|
|
72
|
+
/** The active profile index 0-4, rejecting anything else. */
|
|
100
73
|
private readActiveProfile;
|
|
101
74
|
private readBytes;
|
|
102
75
|
/** One write inside the vendor bracket + commit block, then a read-back. */
|
|
103
76
|
private writeAndConfirm;
|
|
104
77
|
/** Reads `data.length` bytes back and throws unless they match. */
|
|
105
78
|
private confirm;
|
|
79
|
+
private sendFrame;
|
|
80
|
+
/** The bracket is always closed: a session left open hangs the interface. */
|
|
81
|
+
private writeSession;
|
|
82
|
+
private run;
|
|
83
|
+
}
|
|
84
|
+
/** @deprecated `RedragonHidClient` serves the M612 too; the model follows the PID. */
|
|
85
|
+
export declare class RedragonM612HidClient extends RedragonHidClient {
|
|
106
86
|
}
|
|
87
|
+
export {};
|
|
107
88
|
//# sourceMappingURL=hid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hid.d.ts","sourceRoot":"","sources":["../../../src/drivers/redragon/hid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAqB,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"hid.d.ts","sourceRoot":"","sources":["../../../src/drivers/redragon/hid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAqB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2CvF,QAAA,MAAM,eAAe,oCAAqC,CAAC;AAC3D,KAAK,OAAO,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAkChD;;;;;;;;;;GAUG;AACH,qBAAa,iBAAiB;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,KAAK,CAAuC;IAEpD,0FAA0F;gBAC9E,MAAM,EAAE,SAAS;IAU7B,2GAA2G;IAC3G,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO;IAM9C,IAAI,qBAAqB,IAAI,MAAM,EAAE,CAEpC;IAED,aAAa,IAAI,MAAM,EAAE;IAInB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC;IA8CxC;;;;OAIG;IACG,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAanE,kFAAkF;IAC5E,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWvD,6EAA6E;IACvE,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAcjD;;;;OAIG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAehD;;;;OAIG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrE,kEAAkE;IAC5D,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAa1D;;;;;;OAMG;IACG,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAqDzD,qFAAqF;YACvE,kBAAkB;IAOhC,8EAA8E;YAChE,mBAAmB;IAoBjC,oFAAoF;YACtE,kBAAkB;IAwBhC,wEAAwE;YAC1D,WAAW;IAMzB,wDAAwD;YAC1C,SAAS;IAQvB,uHAAuH;YACzG,YAAY;IAmB1B,6DAA6D;YAC/C,iBAAiB;YAQjB,SAAS;IAOvB,4EAA4E;YAC9D,eAAe;IAQ7B,mEAAmE;YACrD,OAAO;YAOP,SAAS;IAKvB,6EAA6E;YAC/D,YAAY;YASZ,GAAG;CAKlB;AAED,sFAAsF;AACtF,qBAAa,qBAAsB,SAAQ,iBAAiB;CAAG"}
|