by HankB99 · 2y ago · 0 comments
My current setup includes two Dell monitors (U2415 with 2x HDMI "MHL" inputs and built in USB-3 hubs.) I'm using these with a Linux X86_64 desktop. I also use Logi vertical mouse and ATK (A.JAZZ) keyboard, both on Bluetooth and both also have dongles.
I would dearly love to use the keyboard/monitor/mouse on a Raspberry Pi 5 (BT and two micro-HDMI ports) with a pure S/W based solution rather than spending $$$ for a H/W KVM switch.
Thanks!
Edit: WRT messy code - no judgement, no shaming here. BTDT.
import hid
VID = 0x046D
HID = 0xB023 # 0xB35B
if __name__ == "__main__":
h = hid.device()
h.open(VID, HID)
h.set_nonblocking(1)
# this works for keyboard
# h.write([0x11, 0x01, 0x09, 0x1F, 0x01] + [0] * 15)
# this works for mouse
h.write([0x11, 0x01, 0x0A, 0x1E, 0x01] + [0] * 15)
h.close()