feeding a mouse driver alternate data in linux
I'm in way over my head and looking for a broader understanding of what it would take to feed alternate data into a mouse driver to control the pointer without开发者_运维技巧 moving the mouse.
I have modified a driver (untested) to provide random data, but I need to be able to turn on/off the random mouse data and I don't think a simple scanf to ask for a "Do you want to do this?" is going to work. I think that I need to build an interface of some kind that will interact with the driver.
Can anybody give me any perspective on this? I have very little idea of what I need to do.
Thanks, Shawn Lewis
That depends on if the mouse driver you've modified is in userspace or kernelspace.
If it's userspace, you could use a UNIX-domain socket as your control channel. If it's kernelspace, you could use a sysfs
entry.
Probably you can read real data from device but send random junk. When you read a click or some movement you can switch to real mode. If no movement in some timeout you can switch to random again. It all depends what are you trying to accomplish.
uinput
can be used to inject input events.
An excellent tutorial about already mentioned uinput
: http://thiemonge.org/getting-started-with-uinput
精彩评论