11 · Rust · USB HID

The problem was the product.

A cheap macro pad shipped with a vendor tool I did not want to trust. The solution was a pure-userspace Linux driver and CLI built around the device’s actual HID boundary.

The constraint

Do not install a kernel module for a six-key pad.

Padawan is a Rust workspace for a Temu six-key, one-knob USB HID macro pad. The goal is deliberately narrow: talk to the device through hidraw, expose useful discovery and profile operations, and keep the vendor software and its assumptions out of the system.

Separate known input from unknown protocol

Standard keyboard input and knob reports work without reverse engineering the vendor protocol. Discovery can identify devices, listen can capture raw input, and profiles can be serialised and inspected. That gives the useful part a stable boundary before any writes are attempted.

RGB control and key remapping are a different problem. Their report layout, command bytes, and save behaviour need USB captures and device confirmation. The code keeps those protocol pieces visibly stubbed rather than presenting guessed bytes as a working feature.

Profiles are the safer interface

The CLI exposes device information, profile creation, profile inspection, application, RGB commands, and input listening. A TOML profile gives the intended key, knob, colour, brightness, and effect state a reviewable representation. The udev helper handles the ordinary Linux permission boundary so the tool does not need to become a root-running daemon.

Reverse engineering needs a stopping rule

The engineering value is not “I made the LEDs blink once”. It is having a repeatable capture path, explicit protocol constants, warnings for unconfirmed commands, and a clear distinction between reading a standard HID report and writing vendor-specific state. That keeps a cheap device from becoming an excuse for opaque software or careless writes.

Current boundary: Padawan solves the host-side device and input problem. Vendor-specific RGB and key-remapping support still depends on confirmed VID/PID and captured report evidence.