haimgel / display-switch

Turn a $30 USB switch into a full-featured multi-monitor KVM switch
https://haim.dev/posts/2020-07-28-dual-monitor-kvm/
MIT License
2.85k stars 112 forks source link

Support bluetooth as well? #41

Open dcarosone opened 3 years ago

dcarosone commented 3 years ago

I've just discovered this, and it seems really cool.

It seems to me that the same method could also work without the usb hub. Lots of bluetooth keyboards will pair with multiple devices and can switch connections between them. Monitorning for this connection appearing and disappearing could also trigger the same result!

haimgel commented 3 years ago

An interesting idea! I can see some possible issues, though:

  1. BT connection/disconnection is usually pretty slow, comparing to USB... Would that be sufficiently fast, to be useful? I don't have such a keyboard to have a first-hand experience.
  2. A cross-platform (windows/macos/linux) Bluetooth enumeration/plug&play detection is going to be challenging! My casual Googling didn't turn up anything useful, so quite a bit of development might be required here.

I'd be happy to accept PRs to support this functionality, but won't have time to implement this in the short-term.

ZyztemeD commented 1 month ago

Could HIDAPI be useful for this ? https://github.com/libusb/hidapi

It detects both USB and BT HID devices and it is multiplatform.