[systemd-devel] [libudev] Obtaining /dev/input/eventx

Lennart Poettering lennart at poettering.net
Mon Jan 25 04:42:26 PST 2016


On Sun, 24.01.16 15:23, Hans-Jacob Enemark (hjenemark at gmail.com) wrote:

> Is it possible to obtain the /dev/input/eventx path from a given USB
> VID:PID combo or similar info, using libudev?
> If so, how ?

Usually one would work the other way round. Scan for /dev/input
devices, and then filter out those not matching the desired vid/pid or
other attributes. I.e. you'd udev_enumerate_add_match_subsystem() to
filter filter for "input" devices and then ignore all that don't start
with "event", and then from the devices you find with that, look for
the parent device until you find the usb vid/pid father you are
looking for.

> 
> All I have seen is getting something like: /dev/hidraw1
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list