Adds discovery support for xf86-input-evdev devices.
Background
Evdev is a generic input device driver that more or less figures out on its own what kind of device it is attached to. It can be used to drive devices that don't have a native kernel driver but are supported by webcamd.
E.g. my multitouch screen (eGalax Inc. eGalaxTouch EXC7910-1057-13.00.00), not supported by the uep driver, runs fine with webcamd.
So far I require the following Xorg configuration to use the device:
Section "Module" Load "evdev" EndSection Section "ServerLayout" Identifier "server0" InputDevice "touch0" EndSection Section "InputDevice" Identifier "touch0" Driver "evdev" Option "Device" "/dev/input/event0" EndSection
Attaching the device while X is runnig is not possible like this. Note that evdev figures out the right thing to do with a device on its own.
Issues Addressed
The two problems addressed by the patch are:
- Discovery of /dev/input/eventX devices during Xorg start
- Attach/Detach of /dev/input/eventX device during Xorg runtime
Approach
To enable startup discovery a new evdev_exists() function is introduced that tests for existing device nodes. This avoids the use of sysctl_exists(), because devices created by webcamd do not show up in sysctl.
To enable runtime discovery the wakeup_handler() is patched to recognise type=CREATE/DESTROY cdev=DEVICE events from the devd socket. The previous check for lines starting with + or - only catches a limited range of devices (excluding /dev/input/eventX).