4
\$\begingroup\$

Ultimately, my goal is to have a "keypad" with between 5 and 10 buttons, where pressing one of those buttons effectively presses some key on two computers simultaneously.

In the ideal scenario, the "keypad" would just plug into both computers, sending whatever signal I generated out over 2 USB lines. As far as I can tell, this flat doesn't work (a single USB device cannot connect to two hosts).

I saw online some instructions for connecting a USB keyboard to a hacked-together pair of PS2-USB adapters (connecting the PS2 side, which apparently is happy to have multiple "hosts" with a single device). Even without doing the hacking part, my current keypad won't work when plugged in via keypad->USB to PS2->PS2 to USB->computer. Cutting apart connectors to allow it to be keypad->USB to PS2->2 x PS2 to USB->computer isn't likely to improve that any. I'm not clear if Windows no longer supports PS2 (saw that somewhere online), if the hardware keypad doesn't send the necessary signal to be "converted" to PS2, or what.

Are there any other approaches I'm missing? Any intelligent ways to do it with software (so the keypad plugs into one computer and that computer sends the signal to the other computer)? Immediacy is pretty important, but that route seems to have some legs.

\$\endgroup\$
4
  • \$\begingroup\$ Could always make it a crafts project: sites.google.com/site/khromtor ... Windows does still support PS2, I'm typing this on a ~10 year old PS2 keyboard on Win7 x64 \$\endgroup\$
    – Nick T
    Commented Dec 3, 2010 at 5:37
  • \$\begingroup\$ Common USB drivers won't connect to 2 hosts, but perhaps you can rewrite your own? LUFA is open source. \$\endgroup\$
    – tyblu
    Commented Dec 3, 2010 at 7:22
  • \$\begingroup\$ For Windows to recognise new PS/2 devices you usually have to reboot it with the keyboard plugged in. Either way, I don't see it working: PS/2 has to transmit data to the keyboard as well (to change settings and keyboard LEDs), not just receive it. \$\endgroup\$
    – Thomas O
    Commented Dec 3, 2010 at 7:52
  • \$\begingroup\$ What you really want is this... Specialized product that works between windows and windows or a separate one between windows and mac. Look at the J5 Connect Wormhole category of products JUC400, JUC500 and JUC700. \$\endgroup\$
    – Fred Hazan
    Commented Aug 4, 2019 at 23:00

3 Answers 3

14
\$\begingroup\$

You are missing the fact that USB is bidirectional serial protocol, and having two USB hosts talking to a single USB device is not supported neither on physical neither on logical level of the protocol. What you can do is to make each key of the keyboard connected to two MCUs each capable of beeing USB HID, and have their USB cables connected to two PCs. You can use two cheap AVR MCUs for this and use USB HID software implementation, just make two identical HIDkeys and connect each key to both. Btw, read the license carefully.

\$\endgroup\$
8
  • \$\begingroup\$ You could use a single MCU so long as it could differentiate between the physical connections. \$\endgroup\$
    – tyblu
    Commented Dec 3, 2010 at 7:54
  • 2
    \$\begingroup\$ what is the issue with the license? \$\endgroup\$ Commented Dec 3, 2010 at 12:10
  • \$\begingroup\$ Wow. This is the perfect scenario. But it's probably too late for me to build out. Thanks for the input. \$\endgroup\$
    – ebynum
    Commented Dec 3, 2010 at 14:34
  • \$\begingroup\$ @smashtastic: If I remember well you are allowed to use it for free with non-commercial projects, and to pay fee if you need to use it in commercial projects. \$\endgroup\$
    – avra
    Commented Dec 6, 2010 at 14:47
  • 1
    \$\begingroup\$ HIDkeys GPLV2 licensed. You can certainly use it in a commercial product so long as you comply w/ the GPL (see gnu.org/licenses/gpl-faq.en.html#GPLCommercially). The HIDkeys site has guidelines for what they think is compliance, but it's really up to you and your attorney to decide. GPL does not require that source for internal-use applications be distributed (gnu.org/licenses/gpl-faq.en.html#GPLRequireSourcePostedPublic). Some would argue a work-for-hire for internal use by your Customers is not public distribution. You should speak to your attorney. \$\endgroup\$ Commented Oct 24, 2016 at 16:18
4
\$\begingroup\$

You could avoid mucking about with hardware quite easily by relaying key-presses on one Windows computer to another with something like PyKeyLogger and SendKeys

\$\endgroup\$
4
  • \$\begingroup\$ So in this scenario, I'd be running PyKeyLogger on the computer with the keypad (to detect the keypresses), adding an app in the middle to receive the keypresses and connect to the remote computer, and an app on the remote computer to receive the signals from the keypad server that uses SendKeys to "press" the keys on the remote computer? \$\endgroup\$
    – ebynum
    Commented Dec 3, 2010 at 14:32
  • 1
    \$\begingroup\$ @ebynum Yes. There might be software that does this already for software multiboxing (see the link in the comment to the question, though that's hardware). Search for "multiboxing software" and see what you get. \$\endgroup\$
    – Nick T
    Commented Dec 3, 2010 at 15:55
  • \$\begingroup\$ Wow. If only I had heard about this multiboxing earlier. Thanks. Looks like HotkeyNet is going to do exactly what I wanted. \$\endgroup\$
    – ebynum
    Commented Dec 3, 2010 at 22:03
  • 2
    \$\begingroup\$ And, in fact, HotkeyNet did do exactly what I wanted. I would still prefer the hardware solution (not dependent on network latency), but this was a perfect in-between solution. \$\endgroup\$
    – ebynum
    Commented Dec 6, 2010 at 18:31
0
\$\begingroup\$

This probably won't help you accomplish your overall goal of simultaneous use of a USB peripheral from two computers, but a USB switch can allow non-simultaneous use of a USB peripheral from two or more computers. They seem to work similarly to a KVM switch, and the cheap switches need to be switched manually, but some also support switching via software.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.