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*).
Tags: device, event, fake, input, kernel, linux, mouse, SoC2008, vignatti, xorg
May 29, 2008 at 1:25 am |
Hey Tiago, check out uinput – cheers, Kristian
June 2, 2008 at 5:27 pm |
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
September 27, 2011 at 3:44 pm |
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.