Intro for those who aren't familiar:

TinyUSB allows a programmable chip (e.g. ESP32, SAM, STM32) to read USB flash drives, or behave as a keyboard and mouse.

A similar library for Arduino is V-USB.

https://hackaday.com/tag/tinyusb/

Question for the experts: is it possible to do USB pass-through monitoring?

Specifically, I have an Apple Magic Keyboard connected to the Dell work PC. I'd like to capture the F7-F12 keys, and use them to control the music on my iPod. Currently I use an AutoHotKey script to send serial commands from the PC, but having 2 FTDI cables plugged in sometimes causes issues.

Yes, I'm effectively suggesting a keylogger, but without trying to record the keystrokes, just use them to trigger another UART. It could also be really nice to remap the Command key to Ctrl (again, I work around this with AutoHotKey, but it's imperfect).

I swear there was a HN post about someone who made a KVM alternative on this principal (pass KB/M through a microcontroller or something and have it act as downstream KB/M to multiple devices) but for the life of me I can't find it. That or I dreamed the whole thing up.

Are you thinking of the display-switch[0] script? Achieves K/V/M-switching with only a cheap USB-switch for hardware K/M-switching, and then this script detects such peripheral switching and emits DDC-commands for monitors to switch accordingly.

I saw it posted here on HN[1], and have been using it since then with great success.

[0] https://github.com/haimgel/display-switch [1] https://news.ycombinator.com/item?id=29608967