> Following up on my own explanations: Again ...
> Event passthrough is not even reaching ikeyd - ikeyd explicitly scans for > the button device _only_. ikeyd needs to be fixed to search for a virtual > keyboard and mouse device _first_, and use that if present. I can cook up > a patch if necessary. While we're at it - ikeyd needs to be made aware of > udev as well. See attached patch - virtual keyboard device is probed first. ikeyd now gets to see events on my system. Test and improve, please. Michael
--- ikeyd.c.org 2006-02-20 18:03:44.000000000 +0100 +++ ikeyd.c 2006-02-20 18:06:30.000000000 +0100 @@ -97,6 +97,7 @@ static int check_pmu (); static void check_pidfile (); static int find_button_device (); +static int find_virtual_device (); static void eject_cdrom (); static void volume_change (int level); static void remove_pidfile (int signum); @@ -180,8 +181,12 @@ exit (EXIT_FAILURE); } - /* now search the button device */ - eventfd = find_button_device (); + /* now search the virtual event devices */ + eventfd = find_virtual_device (); + if (eventfd < 0) { + /* now search the button device */ + eventfd = find_button_device (); + } /* check the pidfile */ check_pidfile (); @@ -585,6 +590,94 @@ return eventfd; } /* »»» */ +/* static int find_virtual_device () ««« */ +static int +find_virtual_device () +{ + /* the filename of the event interface */ + char *filename; + /* the filedescriptor of the event interface */ + int eventfd = -1; + struct input_id id; + char name[256] = "UNKNOWN"; + int i; + + for (i = 0; i < 32; i++) + { + filename = malloc (strlen (EVENT_PATH) + 3); + sprintf (filename, "%s%i", EVENT_PATH, i); + /* try to open the device */ + eventfd = open (filename, O_RDONLY); + /* if opening suceeded */ + if (eventfd >= 0) + { + /* check the id of the event interface */ + ioctl (eventfd, EVIOCGID, &id); + if (want_verbose) + { + ioctl (eventfd, EVIOCGNAME(sizeof(name)), name); + printf("%s: input: %s name: %s bustype: %d vendor: %d product: %d version: %d\n", + PACKAGE, filename, name, id.bustype, id.vendor, id.product, id.version); + } + + if ((id.product & 0xfff) == 0x01f && (id.vendor & 0xfff) == 0x01f) + { + if (!want_quiet) + printf ("%s: Virtual event device found at %s\n", PACKAGE, filename); + event_device = filename; + break; + } + else + { + close (eventfd); + eventfd = -1; + } + } + } + + /* when no event filedesctiptor is set e.g. the event device could not be found */ + if (!(eventfd >= 0)) + { + free (filename); + + /* check if we are root */ + if (geteuid () != 0) + { + printf + ("%s: Couldn't access /dev/input/event* perhaps you are not root?\n", + PACKAGE); + exit (0); + } + + /* check if the kernel module is loaded */ + if (!system ("lsmod | grep evdev")) + { + printf + ("%s: The evdev kernel module is already loaded, so it seems\n", + PACKAGE); + printf ("%s: something else is going wrong.\n", PACKAGE); + exit (0); + } + + /* when the kernel module is not loaded and we are not root + * try to load the kernel module... */ + printf ("%s: I' will try to load some modules...\n", PACKAGE); + printf ("%s: loading evdev...\n", PACKAGE); + if (!system ("modprobe evdev")) + { + printf ("%s: loading succeeded.\n", PACKAGE); + return find_button_device (); + } + else + printf ("%s: Something wrent wong loading the evdev module.\n", + PACKAGE); + + exit (0); + } + + return eventfd; +} /* »»» */ + /* static void eject_cdrom () ««« */ static void eject_cdrom ()