I created virtual mouse driver according to Essential Linux Device Drivers book. After i wrote coordinates echo x y > /sys/ ... /coordinates into sysfs node, my program generates event packets through event interface /dev/input/event5 (i checked this). This event interface is attached to the GPM gpm -m /dev/input/event5 -t evdev. But mouse don't move. I asked this question on stackoverflow and figure out that there might be a problem with X11 configuration. is it possible? What can interfere my driver work in this conditions? i use ubuntu 11.04 on virtual box. Thanks.
Maybe this will help: in Xorg.0.log i see the following:
[ 21.022] (II) No input driver/identifier specified (ignoring)
[ 272.987] (II) config/udev: Adding input device (/dev/input/event5)
[ 272.987] (II) No input driver/identifier specified (ignoring)
[ 666.521] (II) config/udev: Adding input device (/dev/input/event5)
[ 666.521] (II) No input driver/identifier specified (ignoring)
By initialzing the name field of the device and enabling keybit events(BTN_MOUSE), i could get the mouse moving. Im still trying to find the reason why relative events are not working, without enabling key button events.
In the input device driver (i.e Virtual mouse driver init module function), i added the below lines of code just before registering the input device. Rest of the code is same as in the book
// Device name
vms_input_dev->name = "Virtual Mouse";
// Enable relative and Button events
set_bit(EV_REL, vms_input_dev->evbit);
set_bit(EV_KEY, vms_input_dev->evbit);
set_bit(BTN_LEFT, vms_input_dev->keybit);
set_bit(REL_X, vms_input_dev->relbit);
set_bit(REL_Y, vms_input_dev->relbit);
The code worked for me on ubuntu 12.04