libevdev list of event devices

Jake Magee jakemagee at gmail.com
Mon Apr 1 19:39:24 UTC 2019


That's exactly the information I was looking for!

Thanks for the excellent help!
- jake

On Mon, Apr 1, 2019 at 4:08 AM Peter Hutterer <peter.hutterer at who-t.net>
wrote:

> On Mon, Apr 01, 2019 at 08:46:48AM +0200, Martin Kepplinger wrote:
> > Am 01.04.2019 08:32 schrieb Jake Magee:
> > > Hello,
> > > I was wondering if the functionality already exist in libevdev to
> report
> > > a
> > > list of the current event devices?  I've looked through the API
> > > documentation but couldn't find anything.  I'm interested in finding
> > > event
> > > devices on execution and polling for additions / removals while
> running.
> > >
> > > Thanks,
> > > Jake Magee
> >
> >
> > Hi Jake,
> >
> > AFAIK it doesn't. have a look at evemu's find_event_devices() function.
> It
> > doesn't use libevdev but generically does what you want, right?
> >
> > I actually doubt that this is supposed to be part of libevdev, but others
> > might know better :)
>
> yep, martin is correct here, libevdev only takes an already-opened file
> descriptor. The rest is for you to figure out.
>
> Simple explanation: the primary use-cases that sparked libevdev was the
> xorg
> drivers and need for wayland. In both cases the enumeration is handled
> elsewhere, so adding it to libinput didn't bring any benefit. Especially
> because none of them want all event devices, there's always some
> pre-filtering going on.
>
> libinput has a find_device() in tools/shared.c which takes a udev tag as
> input. You can copy that as well if it fits you better than the evemu one
> (also: MIT vs GPL in evemu).
>
> Cheers,
>    Peter
>


More information about the Input-tools mailing list