Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ checklist.
| G-Wolves | `@openmouse/protocol/gwolves` |
| GearHub (AJAZZ / Attack Shark / Lingbao) | `@openmouse/protocol/gearhub` |
| Glorious | `@openmouse/protocol/glorious` |
| Glorious classic (Model O/D/I, Series One Pro) | `@openmouse/protocol/glorious-classic` |
| Glorious classic (Model O/D, Series One Pro) | `@openmouse/protocol/glorious-classic` |
| Glorious Model I (original, wired) | `@openmouse/protocol/glorious-model-i` |
| Glorious core2 (O2/D2 Pro 4K/8K) | `@openmouse/protocol/glorious-core2` |
| Hitscan (Hyperlight web control / native Utility) | `@openmouse/protocol/hitscan` |
| HyperX | `@openmouse/protocol/hyperx` |
Expand Down Expand Up @@ -133,3 +134,9 @@ polling, lift-off and debounce writes have not. See
[docs/glorious-series-one-pro.md](docs/glorious-series-one-pro.md) for those
replies and the resident Compx bootloader protocol (entry, read-back,
erase/program behavior).

The original wired Glorious Model I (`22d4:1503`) has its own driver. Polling
rate, debounce, lift-off distance, the DPI stage table, lighting and profile
selection were written, read back and restored on hardware. See
[docs/glorious-model-i.md](docs/glorious-model-i.md) for the protocol and the
firmware's write behaviour.
29 changes: 29 additions & 0 deletions captures/glorious-model-i-wired/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Glorious Model I, wired (22d4:1503)

Owner captures from a physical Model I on Linux, read and written through
`hidraw` (`HIDIOCSFEATURE` / `HIDIOCGFEATURE`) on the configuration interface
(interface 1, usage page `0xff01`, usage `0x02`). The descriptor declares
feature report `0xA1` with 63 payload bytes and feature report `0xA0` with
1040 payload bytes; every answer carries `0xA0` at [0], whichever report was
read.

`profile-reports.hex` holds whole frames, trailing zeros dropped:

| Label | What it is |
| --- | --- |
| `active-profile` | Answer to `A1 0B 03` (active profile query); byte [16] is profile 1. |
| `dpi-before` | Profile 1 (`A1 0B 07`, profile at [5]) before a combined performance write. |
| `dpi-command` | The `A0 0D 1F` combined write that was sent. Its colour records were sliced from the stored profile instead of being rebuilt, so their `01 <stage>` markers are wrong; the firmware stored the first three bytes of each record as that stage's colour. |
| `dpi-after` | Profile 1 read back after `dpi-command`. Only the packed stage colours (48-65) changed. |
| `dpi-after-debounce-4` | The same write repeated with debounce 4 ms: byte [18] became 4 and so did byte [69]. |
| `lighting-before` | Profile 1 before a lighting write. |
| `lighting-after` | Profile 1 after `A1 0C` with single colour `#ff0000`, brightness 100, speed 60, sleep 255, colour count 0: the block at 147-191 changed and nothing else did. |

Command encoders were also compared byte for byte with the exported functions
of Glorious CORE's `model_i_dll.dll` (SHA-256
`1f30b8e7c5cc249d7a77b8082d1cde9ed2da3c84402fbbbd44bcb40589c9562d`),
executed offline in an x86-64 emulator with every import trapped. The DLL is
not included here.

The reports hold no serial number, name or other identifier. Bytes 81-143
are the unit's normal-layer button assignments, seven bytes per button.
12 changes: 12 additions & 0 deletions captures/glorious-model-i-wired/profile-reports.hex

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions docs/glorious-model-i.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Glorious Model I (original, wired)

USB `22d4:1503`. Codec: `@openmouse/protocol/glorious-model-i`. Driver:
`GloriousModelIHidClient` (`src/drivers/glorious/model-i-hid.ts`).

The Model I was previously listed in the classic Glorious product table. Its
configuration collection declares a 63-byte report, so the classic driver
connected but refused every write. It does not use the classic protocol.

## Transport

Interface 1, usage page `0xff01`, usage `0x02`, two numbered feature reports
(lengths include the report id):

| Report | Length | Use |
| --- | --- | --- |
| `0xA1` | 64 | Commands and short answers |
| `0xA0` | 1041 | Profile answers; the combined performance write |

Every write is followed by GET_REPORT for its answer. Byte [1] of an answer is
the status: 1 done, 3 or 4 busy (read the answer again, do not resend). The
firmware puts `0xA0` at [0] of every answer.

## Commands used

| Command | Bytes | Notes |
| --- | --- | --- |
| Active profile | `A1 0B 03` | Answer byte [16] is 1-3. |
| Read profile | `A1 0B 07`, profile at [5] | 1041-byte answer, see the layout below. |
| Select profile | `A1 0B 04`, profile at [5] | Confirmed with a fresh active-profile read. |
| Performance | `A0 0D 1F`, profile at [5] | Polling, debounce, angle, LOD, stage count, active stage and six X/Y pairs at 16-45; six `RGB 01 <stage>` colour records at 50. |
| Lighting | `A1 0C`, profile at [5] | Effect at 16, 13 RGB slots at 17-55, brightness 56, speed 58, sleep 59, colour count 60. |

Glorious CORE's Model I handler sends polling rate, debounce, lift-off distance
and the DPI table together through the performance command, and it never
offers angle snapping. The vendor DLL also exports one-setting commands
(`A1 0D 01` to `04`). A physical Model I acknowledges them but leaves its stored
profile unchanged, so the codec does not offer them.

## Stored profile (answer to `A1 0B 07`)

| Offset | Content |
| --- | --- |
| 16 | Profile number |
| 17 | Polling interval: 8, 4, 2, 1 for 125, 250, 500, 1000 Hz |
| 18 | Debounce, even 0-16 ms |
| 19 | Angle snapping, 0/1 |
| 20 | Lift-off distance, mm - 1 |
| 21 | Enabled stage count, 1-6 |
| 22 | Active stage, one-based; 0 means not reported |
| 23-46 | Six little-endian X/Y DPI pairs |
| 48-65 | Six packed RGB stage colours |
| 69 | Set to the debounce value by some performance writes; meaning unknown |
| 81-143 | Normal-layer buttons, seven bytes each (not edited by this driver) |
| 147-191 | Lighting: effect, 13 RGB slots, brightness, reserved, speed, sleep, colour count |

The read answers with the profile the mouse is running. With profile 1 active,
requests for profiles 2 and 3 returned profile 1's bytes, including 1 at [16].
The driver therefore only reads and edits the active profile.

## Behaviour observed on hardware

All of the following was observed on one unit through Linux hidraw, December
2026, with every profile backed up beforehand and compared byte for byte
afterwards.

- Polling rate, debounce, lift-off distance, stage DPI, active stage, stage
colour, stage count, lighting (single colour, breathing, wave) and profile
selection were each written, read back and restored.
- About one performance write in thirty (4 of 120 in a dedicated run) is
acknowledged with status 1, but afterwards every profile read answers with
an empty settings block: the profile number, buttons and lighting are
present, bytes 17-80 are zero. Re-reading, querying the active profile,
reading another profile and waiting three seconds did not end it. Sending
the same write again did, every time. The driver re-reads once and then
resends, up to three sends in all. In 80 driver writes, 3 needed one resend
and none failed.
- Once, a lighting write sent 2.5 s after another one was answered with
status `0x07` and not stored. The driver sends such a write again when the
profile shows it unchanged.

Every write sets absolute values, so sending one again cannot compound.

## Not covered

Button assignments, macros, the alternate (Layer Shift) layer, the LED sleep
timer, the remaining lighting effects (Seamless breathing, Breathing RGB,
Tail, Rave) and firmware updates. Separate X/Y DPI is preserved on read, but a
stage edited here gets the same value on both axes.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@
"types": "./dist/glorious-core2/index.d.ts",
"import": "./dist/glorious-core2/index.js"
},
"./glorious-model-i": {
"types": "./dist/glorious-model-i/index.d.ts",
"import": "./dist/glorious-model-i/index.js"
},
"./ksnake": {
"types": "./dist/ksnake/index.d.ts",
"import": "./dist/ksnake/index.js"
Expand Down
3 changes: 1 addition & 2 deletions src/drivers/glorious/classic-hid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { GLORIOUS_CLASSIC_PRODUCTS, VENDOR_ID } from "../vendors.ts";

/**
* Driver for Glorious's pre-Pixart "classic" line (Model O / O-, Model D /
* D-, Model I, Model O V2 — plus the newer "core2" 8000Hz-class mice, Model
* D-, Model O V2 — plus the newer "core2" 8000Hz-class mice, Model
* O3 Wireless and Model D 2 PRO 4K/8KHz Edition, on a reduced feature set —
* see the `generation` doc comment on `GLORIOUS_CLASSIC_PRODUCTS` in
* vendors.ts for why). The config channel is a feature report, usually 64
Expand Down Expand Up @@ -110,7 +110,6 @@ export class GloriousClassicHidClient {

static isSupported(device: HIDDevice): boolean {
if (device.vendorId !== VENDOR_ID.gloriousClassic
&& device.vendorId !== VENDOR_ID.gloriousClassicI
&& device.vendorId !== VENDOR_ID.gloriousClassicIWired
&& device.vendorId !== VENDOR_ID.gloriousO3) return false;
if (!GLORIOUS_CLASSIC_PRODUCTS.has(device.productId)) return false;
Expand Down
Loading