Inject
INJECT sets a momentary input on top of native input: a mouse button, a keyboard key or modifier, or a media key, tagged by a class byte.
The continuous axes (cursor and wheel) use MOVE.
INJECTMomentary-usage override
INJECT sets a per-usage override, a held level layered over native input. Opcode 0x03.
INJECT 0x03 · payload 4 bytes
Fire-and-forget
| Offset | Field | Type | Notes |
|---|---|---|---|
| 0 | class | u8 | 0=button 1=key 2=media (the input kind) |
| 1 | id | u16 | usage within the class, little-endian (see below) |
| 3 | action | u8 | 0=soft-release 1=press 2=force-release |
| Name | Value | id is |
|---|---|---|
| button | 0 | a semantic button id (0=Left .. 4=Side2, then numeric to the declared count) |
| key | 1 | a HID keyboard usage (0xE0-0xE7 = modifier) |
| media | 2 | a 16-bit Consumer usage |
| Action | Value | Effect |
|---|---|---|
| press | 1 | Force the usage active regardless of native state. |
| soft-release | 0 | Drop the override (press or force-release). A hold on the real device stays active. |
| force-release | 2 | Force the usage inactive, masking a hold on the real device too. The safety auto-clear uses it. |
The releases differ only while the same input is held on the real device:
| Action | Not held | Held |
|---|---|---|
press | active | active |
soft-release | inactive | active (native bit relayed) |
force-release | inactive | inactive (masks native) |
additive layers over native input at the same merge point as
MOVE; never evicts it
no click no firmware click or chord; send a press, then a
client-timed soft-release
RESET releases every override at onceIf the cloned device can't report a usage, injecting it changes no report field. Check CAPS first.
Library binding: inject.
class = button Mouse button override
With class = 0, id is a semantic button id: 0=Left, 1=Right, 2=Middle, 3=Side1, 4=Side2, then numeric ids up to the CAPS count. The five named ids are bound to the mouse's buttons at clone time. The override sets that button's bit in the emitted report.
Injecting a declared but unwired button is descriptor-faithful: the box drives every declared button. An id past the declared count reaches no report field, like an unmapped key.
Library bindings: inject / press / release / force_release.
Press Left: class 0x00, id 0x0000, action 0x01:
class = key Keyboard key and modifier override
With class = 1, id is a HID keyboard usage. 0xE0-0xE7 fold into the modifier byte. Anything else fills a keycode slot (or sets its NKRO bit) in the emitted report.
Native keys keep their slots, so injection never evicts them. Past the board's rollover limit, the box emits ErrorRollOver, as the board does. A keycode the cloned board can't report is a no-op. Library bindings: inject / press / release / force_release.
Press A: class 0x01, id 0x0004, action 0x01:
class = media Media key override
With class = 2, id is a 16-bit Consumer usage (e.g. 0xCD Play/Pause, 0xE9 Volume Up), merged onto the cloned keyboard's Consumer report.
Has an effect only if the board declares a Consumer collection (the CAPS CONSUMER flag). Library bindings: inject / press / release / force_release.
Press Volume Up: class 0x02, id 0x00E9, action 0x01: