So the whole thing is made in Arduino, one Attiny85 board acting as a USB client, a HID keyboard, and another board, a Nano (ATMega 328P) on the lookout for button presses. The two communicate via serial.

And the source code is published on github here (the USB-handling attiny85) and here (and the buttons-handling nano).

Below is the very first, unoptimized implementation, barely fitting onto the flash.