Mapping XInput devices to /dev node

Daniel Stone daniel at fooishbar.org
Tue Jul 17 10:08:10 PDT 2007


On Tue, Jul 17, 2007 at 05:27:25PM +0200, Nicolas Trangez wrote:
> On Tue, 2007-07-17 at 23:41 +0930, Peter Hutterer wrote:
> > Nicolas Trangez wrote:
> > > if I got a list of XDeviceInfo structures (which include a device ID),
> > > is it somehow possible to figure out the device file
> > > (/dev/input/eventX, /dev/input/mouseY, whatever) behind this device? 
> > 
> > Nope. Not even the server stores this information. It is only used by 
> > the driver and while it can be stored in various private fields, there's 
> > no client access to it.
> So there's no way to get a somewhat more user-friendly name than
> "Logitech Thuis-usb-0000:00:1d.0-1/input0" (where "Logitech Thuis" is
> the name in my xorg.conf), unless I split on the first "-", which isn't
> failure-proof. Bummer.

Well, you can't guarantee that you're a) speaking to a local server, and
b) using evdev.  So you're stuffed in any case.  Really, the evdev
driver shouldn't be using such pathological naming, IMO.  If clients
need to disambiguate, they can add #1, #2, etc on their end.  Adding the
phys doesn't seem to have any real world use, and in any case, only
encourages clients to circumvent the server, which is bad: you
effectively have two drivers, instead of one.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070717/65eb2ddf/attachment.pgp>


More information about the xorg mailing list