Wired, physical switch (button) control for a KVM that does not have any control beyond keyboard hotkey combinations (e.g. scroll-lock twice + number key).
Using the Raspberry Pi Zero, the lowest cost, USB Human Interface Device (aka HID) emulation in the Pi lineup, a shell script on startup creates the necessary HID keyboard interface on boot (/dev/hidg0
). Next the python controller.py is launched, which setups callback listeners to our Pi GPIO pins (29, 31, 33, 35) for button presses, then goes into a permanently signal interrupt loop. Upon a button press, the SwitchKVM()
function is called with our button, which is mapped to sending the corresponding key sequence to our virtual keyboard (Scroll-Lock + Scroll-Lock + 1-4).
- Raspberry Pi Zero
- TESmart 4x1 KVM 4K@60Hz
- Project box with mount wings for under-desk mounting
- Micro USB cable - this will both power our Pi Zero and be the USB client for our keyboard
- Momentary push buttons and wire