Version 1.0 Working! (almost)

A project log for Driverless Mouse and Keyboard Sharing

Instantly share mouse and keyboard across computers on any platform.

frankstripodfrankstripod 04/27/2015 at 01:157 Comments

I have been gone for a while, sorry. I finally got a spot to set up my desk and computers, and I realized I had all the parts I needed to piece something together.

I seriously want to make a real circuit board and make this project legitimate... Oh crud, I dead bugged it again... I thought this was a work around for cost, but forces me to realize my fear of asking for help.

The Major Problems

My original brainstorm, to count pixels and determine mouse location before and without communication with a computer, turns out to be more storm than brain. I have come up with two solutions to this, the first being the working version 1.0 prototype that cheats.

The second solution will be a long term experiment (with the pixel counting, or something), and a more powerful processor, possibly Intel based with Linux. This would keep my my other concept going, that it is possible to replace computer software drivers with an external hardware module system. The problem with the second solution is keeping the cost down. It will eventually get its own project log.

Getting this to work as intended is in need of a crude USB hack, that tricks the host computers into thinking the devices on this hub never get disconnected, even though they are switched around. My limited bubbled search leads me to believe it is an impedance hack, but there might be more to it then soldering four resistors on the USB output connectors.

Version 1.0 Prototype Cheats:

Cheat 1. Use the Teensy touch sensors with thin wire and sticker like buttons, in any or all of the four combinations:


Cheat 2. A Python Script (not working yet) on each computer that detects cursor edge position, then signals for the Teensy to do the switching through USB Serial. I know this really breaks my rule of No Drivers, and probably many other rules of common sense in programming, but it will look cool :)

All I have so far is for Windows only in the Python Shell, and where "yay left" and "yay right" = missing Teensy USB Serial code.

Python 3.4.3 32bit Win7 with pywin32 from:

import win32api

screenx, screeny = 1279, 1023
x, y = 1, 1

def detect(x, y):
    while x > 0 and x < screenx:
        x, y = win32api.GetCursorPos()
    return x, y

x, y = detect(x, y)
if x == 0:
    print ("yay left")
if x == screenx:
    print ("yay right")

I would definitely need a Linux and Mac solution also (help!)

Q? Would putting in a delay (from time import sleep, sleep(0.1)) make it less taxing on the CPU?


Cheat 3. I hacked it from other working devices that I had laying around...

"Oh crud, I dead bugged it again"

I used two 4pin headers as a floating socket so the Teensy is removable.

LED's poke out the front show which port is selected. Another 4pin header also pokes out revealing four touch pins from the Teensy.

I used the relay and diode from my mouse project.

Back view:

More pictures, USB cables, and hopefully a video of it all working will be posted soon.


rawe wrote 05/06/2015 at 07:08 point

Being driverless and working with all mayor OSes is the great revolutionary unique thing about your KVM switch, so that core feature should work on a prototype to demonstrate the feasibility.

Regarding driverless edge detection, what about...

- track absolute screen position (in the whole virtual big screen space) on the microcontroller

- use absolute position USB mouse HID to set the position of the mouse:;; either use 1 usb HID and switch this around, or use 4 usb HID and send the data to the right one.

I have no idea how this behaves if one of the connected computers got multiple screens in a strange arrangement (afaik, synergy got problems with such a setup as its approach is "1 computer = 1 screen")

This may break games that reset /"catch" the cursor to the screen center and grap the deltaX/Y for view movement every frame. But as this will break synergy, too, I see no real problem with this.

Btw. the 8 channel Belkin KVM switch I use got 8 USB-PS/2 converter chips, one for each client and they switch the PS/2 signals from Keyboard and Mouse. A microcontroller niffs the keyboard lines, controls the multiplexer (and triggers an OSD chip to overlay the screen number on screen).

Edit: Oh nvm, already commented on this topic 8 months ago

  Are you sure? yes | no

frankstripod wrote 05/10/2015 at 11:17 point

@rawe so sorry I missed your comment! I can't imagine how I missed it in my feed, because I have been following you since the beginning :)

That Belkin upgrade is a fantastic idea! There are so many old commercial PS/2 KVM's that cost a fortune, that you may be able to get cheep (of even free;) Got any pics of the 8 channel thing?

Thank you for the link. Always appreciate your input!

  Are you sure? yes | no

esot.eric wrote 04/27/2015 at 05:25 point

All that stuff fits in there like it was meant to be together!

Lots of good laughs in here...

Solder-flux-stain clearly-labelled...

Isn't that a pop song... "Oops, I dead-bugged it again"

Why must the computers not detect the plug/unplug of the mouse? Does it reposition to the center, or something?

  Are you sure? yes | no

frankstripod wrote 04/27/2015 at 07:38 point

Hi Eric!
The plug/unplug thing: First of all, because of Windows. Plugging in a USB device in my win7 laptop can randomly go into permanent wheel spinning mode searching the entire internet for USB drivers only to find out "the best drivers" were generic and found on my own laptop. This randomly happens for a mouse (or keyboard) that it already knows, has the correct drivers for, and has been plugged in hundreds of times (Linux seems so much better for handling mounting/unmounting.) To be fair, that doesn't happen often, and I do have a funky set up, where I always use two mice, and always unplug the keyboard stolen from my wife, and forget to eject stuff.

I would like to think I could list a dozen other reasons, some that elude me now (I need a list). I would like to avoid remounting for quick switching to get fluid cursor movement. I would also like to see if I can fry a USB stick by using it to share data between PC's without ejecting.

  Are you sure? yes | no

frankstripod wrote 04/27/2015 at 07:52 point

It does fit in there like it was meant to be together! I don't know why it worked, but it did (3.5" drive bay). The mouse doesn't center, it stays where it was left off, so I might need to hide it.

  Are you sure? yes | no

esot.eric wrote 04/27/2015 at 14:33 point

Heh! Even if it happened only every-so-often, that would be a total annoyance and kinda defeat the purpose of your switch-box :(

Hope your USB-hacks work! 

If you want a copy of "USB2.0 Complete" I have two books, somehow ;)

  Are you sure? yes | no

frankstripod wrote 04/28/2015 at 03:43 point

Thank you for offering! I will keep that in mind :)

  Are you sure? yes | no