Question

Is it possible to create multiple uinput devices and if so how to do it? I'd like to create multiple separate game controllers. Thanks for any help.

Was it helpful?

Solution

Yes. Every time you open the uinput device node, you get a file descriptor for a new virtual input device. This will persist until you close the file descriptor. The API is low level, basically a variant on the same API inside the kernel. You use ioctl() calls to configure the device (i.e. how many axes? How many buttons? etc...) and then write() raw event structions into the descriptor.

Have you tried stepping through the tutorials out there? This is the first hit on Google: http://thiemonge.org/getting-started-with-uinput

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top