views:

42

answers:

3

Hey...

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

+1  A: 

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.

Goran Rakic
+2  A: 

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.

caf
ioctl() would work too. Does writing to sysfs cause the userspace process to block until the kernel acks? Sometimes disk sleep is useful for pointing out problems. Note, I'm not promoting ioctl() :)
Tim Post
+1  A: 

uinput can be used to inject input events.

Ignacio Vazquez-Abrams