I am in a project where I will need to write a simple driver that accepts input from a USB device and preforms actions on GUI according to the received msg (Like writing a usb mouse driver but with my own protocol). I am searching the possibility of this and I found software testing automation tools like LDTP that already can generate actions like mouse clicks and keyboard hits . Are there other APIs to use ? How long it will consume given that my team has good understanding of C language and no experience with Linux ?
You have basically two options, that I can think of:
XTestFakeDeviceKeyEvent, XTestFakeRelativeMotionEvent, etc.)The first one makes use of fake input devices (try running xinput list in the shell) that are present in most (all?) X servers. Each call to one of the XTestFake* function generates an X input message.
The second one is a kernel module that allows a user application to create input devices and send input events. You simply open the /dev/uinput device, send a few ioctls to configure it, and then write the input events directly.
And, of course, you can write an input kernel driver!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With