Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulating a keyboard's output (making a computer pose as another computer's keyboard)

I want to be able to connect a computer A's USB port to computer B's USB port so as to make computer A act as computer B's keyboard.

Any idea how I would go about doing that?

I'm not looking for a ready-made solution (though if one already exists and is open-sources I would not object), but for a starting point or a good resource.

I imagine I'd need to write a driver that simulates the keyboard's protocol, and I would also need to sort out the entire USB master/slave scenario.

Anyway, any help would be appreciated.

P.S. I want to do it with the mouse as well, but I imagine it will be a very similar process, and I think (but I might be wildly mistaken) that starting with the keyboard will be easier.

like image 210
Anonymous Coward Avatar asked Sep 13 '10 08:09

Anonymous Coward


People also ask

What are the 2 ways a keyboard can be connected to a computer?

Today, almost all wired keyboards use USB as the interface to the computer. Older computers may use PS/2 as an interface to the computer. If your keyboard is wireless (cordless), it can be communicating over Bluetooth, RF (radio frequency), or IR (infrared).


2 Answers

I am really excited to have found something that will do this from Hagstrom Electronics. It take a serial input and sends a USB keyboard output to another PC. If you combine this with a readily available USB to serial adaptor, then you are golden.

http://www.hagstromelectronics.com/products/usbkm232.html

I have been searching for weeks to find this, so I decided to go back to some forums and share the discovery.

like image 72
Will Sommerville Avatar answered Sep 28 '22 03:09

Will Sommerville


Linux has support for USB gadget mode, but I think you need special hardware for that. I.e. the USB port in a normal PC can not do gadget mode.

An alternative is to wire an LPT port to a PS/2 keyboard input, this is technically simpler.

like image 36
Sjoerd Avatar answered Sep 28 '22 01:09

Sjoerd