DIY USB sharing hub

Local shops wanted close to $100 for a mechanical USB switch, to share a USB keyboard and mouse between two computers. I accomplished the same thing with a cheap compact USB hub, an old keyboard and a 3 pole switch for less than $10.
The keyboard is wired to one of the USB hubs ports, the 3PDT switches the hubs two data lines plus the 5v+ rail. In an ideal world, the ground and shield should be switched too, but I only had a 3 pole switch and limited room.

I decided to put the hub inside the keyboard to reduce clutter, fitting everything in was the hardest part of the project, and not something I’d do again.
It works beautifully but there is a 10 second lag when switching to a Vista machine while it searches for the drivers for the mouse and keyboard, but it’s still easier than swapping the keyboard plug between machines.




thanks, you’ve been a big help, i placed all my components in a plastic electrics box from radioshack
I have a wireless keyboard that uses a dongle to connect to the keyboard. If i just have a female usb port slotted into where the hub is, i could achieve the same result?
sorry – I dont really understand what your question is
for example, if i have a Wireless mouse (the ones that have that dongle that plug into the pc…) Could i instead f having that hub there, have a female port(like the ones in your pc) and wire it up the same way you did?