keysatron
C STM32 TinyUSB KiCad PCB design
A small board that sits between a USB keyboard and a computer. The keyboard sees a host, the computer sees a keyboard, and every report in between is rewritten on the fly. Because the remapping happens in hardware, a custom layout works on any machine you plug into, including locked-down work laptops where installing keyd or AutoHotkey is not an option.
The hardware is a 4-layer board around an STM32F405, chosen because it has two independent USB OTG controllers: one runs as USB host for the keyboard, the other as USB device toward the computer. A buck converter steps the 5 V bus down to 3.3 V, the data lines are ESD protected, and an SWD header is broken out for flashing and debugging. Schematic, layout, Gerbers, and a pick-and-place file with LCSC part numbers are all in the repository, so the board can be ordered fully assembled.
The firmware is bare-metal C on top of TinyUSB. It implements my famak layout — four layers on hold keys (symbols, navigation, numpad and system shortcuts) — as plain lookup tables, so changing a key is a one-line edit. Two host profiles mirror the Linux keyd and Windows AutoHotkey versions of the layout and can be switched with Win + Enter; Win + Esc drops to raw passthrough. A status LED blinks the active profile and state back, since the device has no other way to tell you what it is doing. The whole toolchain runs in a Docker container, so building and flashing need nothing installed on the host.