Usage IDs
The id numbers inject and lock takeINJECT and LOCK both name an input by an id, and the numbers depend on the class: a button id for the mouse, a HID keyboard usage for a key, or a 16-bit Consumer usage for a media key. They're gathered here so the command pages stay short.
HID keyboard usages
Keys and modifiers (class = key)The id is a HID Keyboard/Keypad usage from the USB HID Usage Tables (page 0x07). A usage of 0xE0-0xE7 is a modifier and folds into the modifier byte; any other usage fills a keycode slot. The common ones:
| Key | Usage |
|---|---|
A .. Z | 0x04 .. 0x1D |
1 .. 9 | 0x1E .. 0x26 |
0 | 0x27 |
| Enter / Escape / Backspace / Tab | 0x28 / 0x29 / 0x2A / 0x2B |
| Space | 0x2C |
| Caps Lock | 0x39 |
F1 .. F12 | 0x3A .. 0x45 |
| Insert / Home / Page Up | 0x49 / 0x4A / 0x4B |
| Delete / End / Page Down | 0x4C / 0x4D / 0x4E |
| Right / Left / Down / Up | 0x4F / 0x50 / 0x51 / 0x52 |
| Modifier | Usage |
|---|---|
| Left Ctrl / Shift / Alt / GUI | 0xE0 / 0xE1 / 0xE2 / 0xE3 |
| Right Ctrl / Shift / Alt / GUI | 0xE4 / 0xE5 / 0xE6 / 0xE7 |
The Rust library exposes these as named Key constants (Key::A, Key::LEFT_SHIFT, ...).
Consumer usages
Media keys (class = media)The id is a 16-bit usage from the Consumer page (0x0C) of the USB HID Usage Tables. Present-gated to a board with a Consumer collection, read from the CAPS CONSUMER flag. The usual transport controls:
| Media key | Usage |
|---|---|
| Play / Pause toggle | 0x00CD |
| Play | 0x00B0 |
| Pause | 0x00B1 |
| Stop | 0x00B7 |
| Next track | 0x00B5 |
| Previous track | 0x00B6 |
| Mute | 0x00E2 |
| Volume up | 0x00E9 |
| Volume down | 0x00EA |
The Rust library exposes these as named MediaKey constants (MediaKey::VOLUME_UP, ...).