PDA

View Full Version : One USB keyboard to Two USB Ports



picnaut
- 10th June 2009, 23:31
Hello,

I have an interesting project and I wonder if anybody would like to provide some input on it.

First, the problem and what I "think" I need to do to solve it:

I have a Logitech G15 gaming keyboard and it's amazing! I also have an Aten CS1784 DVI/USB KVM switch, and it's also a pretty great piece of gear.
There's only one problem: they don’t really “like” each other very much.
If you connect the keyboard to the 'keyboard' USB port on the KVM, the switching function (i.e. “scroll lock – scroll lock – ENTER” switches to the next PC) will work, but the keyboard response for everything else is really sketchy. Sometime the keystrokes will be received sometimes not. Other times the key will just start repeating for no good reason. So, when connected to the 'keyboard' USB port on the KVM switch my Logitech G15 is just a really expensive KVM controller. Not good. However, if I connect a generic keyboard to the KVM’s 'keyboard' USB port then everything works properly.
Now, if I plug the G15 into the KVM’s 'hub' USB port, voila! It works perfectly! Good news right? Wrong! Although the keyboard works fine now, because it’s not connected to the 'keyboard' USB port I can’t use it to control the KVM’s switching functions (i.e. “scroll lock – scroll lock – ENTER” does absolutely nothing).

So, what I want to do it this…

I want to keep the G15 connected to the KVM’s 'hub' USB port, but I want to somehow intercept or “sniff” the commands being sent from the keyboard through the KVM to the active PC using a PIC, and I want to intercept them at the point between the keyboard and the KVM's 'hub' USB port. Then, I want to detect only the key presses that are related to KVM switching and pass these key press commands along to the KVM switch’s 'keyboard' USB port (if I pass everything along then I will get double-type on the screen). I’m pretty sure that passing the commands along will be easy, but it’s the “sniffing” that I’m not sure about.

So, has anybody done this before (or something similar) or think they may know how to do this? Even more importantly, if anybody knows of a product that already exists that will basically fit my needs, I’d be very interested, because I’d rather not waste my time with this if I don’t have to.

Anyway, please let me know.

Cheers!

Darrel Taylor
- 11th June 2009, 00:04
I've learned to Never say Never, because someone will invariably show you how to do it.

But, I'm pretty sure you can't "sniff" the keystrokes.
A 12megabit/sec half-duplex data stream is beyond the capabilities of a PIC.

Even using a USB "host" like the Vinculum or USBwiz will only work with standard keyboards. The gaming keyboard needs special drivers on the PC that the "host" controller doesn't know about. Which is also why it doesn't work with the KVM's "host controller".

What if you made a separate device with a few push buttons that only sends the KVM commands?
A Little box sitting next to your keyboard.

This should be easy(er) with an 18F2550 or similar.
<br>