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.
Is it possible to create multiple uinput devices and if so how to do
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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