Simulate USB keyboard from machine

5

4

I want to use one PC as a USB keyboard for another PC. It has to be indistinguishable from actual USB keyboard. How can I achieve this?

A solution that works with any of Ubuntu Linux 14 and above, OS X 10.11 or Windows 10 would be acceptable. Should work with USB 2.0 or 3.0.

EDIT: the machine to receive the input should not require any specific software installed or network access. I need to use a physical USB cable and the destination machine should react as if a physical keyboard is present on that USB port.

miguelv

Posted 2016-09-26T11:04:54.117

Reputation: 159

it is about: computer software

and i'm not asking about a product / service / learning material recommendation – miguelv – 2016-09-26T11:10:31.730

1I have reworded your question so that it doesn't sound like software recommendation question. – gronostaj – 2016-09-26T11:11:59.307

ok, maybe it's not a software recommendation, but still of a low quality. What OS do you use? What have you already tried ... Please read How do I ask a good question? and improve it.

– Máté Juhász – 2016-09-26T11:15:41.823

I acknowledge the low quality and have made the edits, but those are not the points you raised in the first place. And frankly I'm a bit disappointed at the community since I've had to jump from Stack Exchange community to community and always getting dismissed as off-topic or as too generic of a problem and very little constructive effort from anyone except @gronostaj being put in to help me solve a genuine problem that should have a well known solution IMO. – miguelv – 2016-09-26T11:23:05.643

The question is very clear to me, and I agree it should have better answers. Imagine you have a machine you can't change the software on, but it does have a USB keyboard. You want to automate some typing by using another computer to simulate a USB keyboard device. Surely there are existing devices for this. – Greg Chabala – 2019-03-19T01:09:44.373

Answers

3

You could use a Raspberry Pi Zero in USB gadget mode. In this mode, the Raspberry Pi can behave as many standard USB devices (keyboard, mouse, mass storage, etc.) and you will then be able to e.g. "inject" keystrokes from a program running on the Pi (and you can then control this program remotely as you see fit).

The Raspberry Pi Zero is not the only device allowing this; but it's cheap, it's easy to get one, and there are many documentations out there explaining how to do this, so it's (IMHO) a pretty good starting point for a project like this!

jpetazzo

Posted 2016-09-26T11:04:54.117

Reputation: 161

1

You can use usbip to make USB devices (including a keyboard) on a host computer available as USB devices on a client computer over the network. As it's a USB device, it will be indistinguishable from any USB device attached locally.

Clients exist for Windows, and usbip has been a standard part of the kernel for a long time. Under Debian and Ubuntu, the usbip package contains the programs to set up and control such a connection.

Details on how to set it up can be easily googled, e.g. here

Similar questions:

dirkt

Posted 2016-09-26T11:04:54.117

Reputation: 11 627

1Appreciate your response, but what I was going for involved an actual physical USB cable and should not require installing software on the machine where that I want to send the input to. – miguelv – 2016-09-26T15:30:26.740

1@miguelv: You need USB device hardware in order to be seen as a keyboard device. No amount of software will cause a USB host port to act as a device. – Ben Voigt – 2016-09-26T16:07:31.567

Huh. What is the reason you don't just unplug the USB keyboard from the one PC, and plug it into the other PC? They are apparently close enough to put a cable between them. In other words, what's the actual problem you want to solve? – dirkt – 2016-09-26T17:14:14.503

And to add to @BenVoigt, finding any sort of hardware for a PC that's going to act as an USB client (no matter if it's USB OTG or not) will be damned difficult. – dirkt – 2016-09-26T17:15:38.157