Simulated keyboard/mouse

I am planning to create a USB link between two computers that would allow me to send keypresses and mouse events between them over a USB link. After some extensive googling I learned about Arduino and it looks like Arduino Due is what I need for this as it already has two USB ports, one for programming/control and another one that can be a HID keyboard/mouse to the PC it is connected to. My plan is to use serial interface from the controlling computers to send what keypresses must be simulated and then send them over another USB port to the second PC. It all seems feasible and even rather easy, but I might be missing something obvious because I have never seen an Arduino board myself. So I hope I can get some answers here:

  • I assume I need iether Arduino Due or Arduin Yun for this to be able to maintain both links?
  • Any issues if I connect both USB ports to the same or different PCs?

Thanks in advance!

You might want to take a look at the leonardo .

cjdelphi:
You might want to take a look at the leonardo .

I would really appreciate some more details why. I found this code sample that apparently does what I plan to do for Leonardo, Due, and Mini. Out of these 3 only Due seems to have 2 USBs though, meaning that I'll probably need to find a way to add another USB to it. Is something wrong with Due other than slightly higher price?

You can use a due, but the Leonardo runs on 5v, it just makes life much easier.

The 1 usb port is not an issue, when you upload your sketch, it resets the leo and then begins the bootloader which checks to see if anything is waiting to be uploaded.

A few seconds later, your sketch starts and starts waiting for whatever it is you're waiting for (button press, a usb Serial command) all via the same USB you used to upload your sketch to, it's 5v tolerant (ie, the due is not, if you accidentally crossed paths (eg simply moving a jump wire on a breadboard, just once with a 5v source going to a pin or exposed, your due is dead.)

Of course the Leonardo is cheaper, but you're highly unlikely to destroy it accidentally if you stick to 5v.

You want two USB ports.

The Leonardo or "Micro" can emulate a HID, so you use that interface where you need it to produce ersatz keypresses.

You can use a software serial emulation to have it communicate with one of the many and cheaply available USB to TTL converter modules as a second port.