fakemouse — a driver that emulates a mouse

For my SoC project I need some mechanism to evaluate the improvement of the input thread inside X. So I wrote a simple kernel driver that emulates the mouse device moving and emitting bits of a simple pattern. I don’t know if something like this already exists or if there are other ways to do it, but the fact is that the solution I thought took me only few hours between the moment that I imagined, collected some ideas on the Web and implemented it.

Why emulate a device? I need stress the X server always with same routines and things like XWarpPointer() and XTestFake*MotionEvent() is not close to a real user usage because they do not pass through all the paths of the event creation stage inside X. So now I can run fakemouse module together with some x11perf test and collect the results comparing the X with and without input thread. Cool :)

For those who are interested in the driver can do the following:
# wget http://web.inf.ufpr.br/vignatti/code/fakemouse-0.01.tar.gz
# tar xzvf fakemouse-0.01.tar.gz
# cd fakemouse-0.01
# make
# insmod fakemouse.ko
# echo 1 > /sys/module/fakemouse/parameters/mouseon

and be happy seeing what happens in some event node create by fakemouse (/dev/input/event*).

About these ads

Tags: , , , , , , , , ,

3 Responses to “fakemouse — a driver that emulates a mouse”

  1. Kristian Hoegsberg Says:

    Hey Tiago, check out uinput – cheers, Kristian

  2. vignatti Says:

    Good point Kristian. Thank you.

    If you are interested in some tool to inject any kind of device and events in a totally flexible way from userspace then uinput is what you want. See here.

    http://svn.navi.cx/misc/trunk/inputpipe/uinput/uinput.txt

  3. Anonymous Says:

    need windows version so i can use it with multipoint because i iam designing an education type windows service with mouse emulation but i need to emulate mouse input like mouse movement and clicks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: