getting device path or sysfs name of input device

Tias tias at ulyssis.org
Sun May 9 06:41:52 PDT 2010


Hello,

I'm developer of the xinput_calibrator calibration program for 
touchscreens. xinput_calibration is currently a userland application 
that uses the XI protocol to get input information from the X server 
(like xinput does).

I want to make the calibration permanent, and not just applied when the 
program is run.

I'm currently convinced that the cleanest way to do this would be to 
create a udev rule that supplies the right x11_options when the hardware 
is plugged in (or on boot, or X restart etc.)
[see 
http://wiki.github.com/tias/xinput_calibrator/making-calibration-values-permanent 
for other alternatives]


To do this, I need the 'sysfs' name of the device.
However, the XI protocol identifies a device by its XID or by its device 
name. But this device name is not guaranteed to be the sysfs name! This 
device name is the 'identifier' that the user supplied in his xorg.conf, 
or the default device name of the driver.
In case of the evtouch driver this is always 'EVTouch TouchScreen', only 
evdev has the nice default behaviour that it copies the sysfs name as 
default identifier; but this can be overwritten in a config, so it is 
not a robust solution.


So my question is:
- how can I ask the Xserver for the sysfs name of a device (having its XID)
- equivalently: how can I ask for the input device path (I can then use 
udevadm to find the sysfs name)
- or alternatively: how can I query the running xorg config of a server 
(I could get the device path from the correct section that way)


Thanks in advance,
Tias



More information about the xorg mailing list