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*).

4 thoughts on “fakemouse — a driver that emulates a mouse

  1. 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.

  2. Wow its old post, but im very need this info.
    Hi Thiago or Hi Mr. Thiago, I see your post in 2014th year ago, are you still alive? Hahaha, I just kidding.
    I need your help, can you help me?
    I want to change my mouse driver. So my pc read my mouse not a mouse device, but other device like joystick, steering wheel or new device.
    So my goal is build a new device using a mouse.
    Wow, its impossible project Thiago?
    If this is impossible project, can you make to possible project?
    Sorry of my bad english

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s