[systemd-devel] [PATCH] udev: Add keyboard leds helper app

Carlos Garnacho carlosg at gnome.org
Fri Jan 17 05:19:18 PST 2014


Hey,

On vie, 2014-01-17 at 13:10 +0100, Lennart Poettering wrote:
> On Fri, 17.01.14 13:01, Carlos Garnacho (carlosg at gnome.org) wrote:
> 
> > 
> > Hey Lennart :),
> > 
> > On vie, 2014-01-17 at 12:04 +0100, Lennart Poettering wrote:
> > > On Fri, 17.01.14 12:01, Carlos Garnacho (carlosg at gnome.org) wrote:
> > > 
> > > > This helper program checks the leds available on keyboard devices
> > > > and exports these as list of keywords in the ID_INPUT_KEYBOARD_LEDS
> > > > property. The new .rule ensures this helper program runs at the time
> > > > any keyboard is detected/plugged.
> > > 
> > > What's the usecase for this?
> > 
> > Complementing this code, I've got a gnome-settings-daemon patch to show
> > an OSD to hint about *Lock keys being pressed when the keyboard in
> > question does not have leds to tell so. The laptop I got recently has
> > none, and it buggers me when I start yelling without noticing.
> 
> Hmm, so the idea here is to attach this information to the udev devices,
> so that it is available unprivileged?

Yeah, pretty much.

> 
> Wouldn't it be more accurate to expose this information via xinput? (Not
> saying that we shouldn't merge this into udev anyway, just asking...)

I generally agree there, although at the time it kinda feels like
putting a square peg in a round hole... Xserver input drivers generally
do a quite good task at handling those events directly wrappable by
XEvents (that is, EV_KEY/REL/ABS). but the API provided to drivers is
constrained to cover those, everything else is ignored or handled within
the driver. 

Without adding extra infrastructure to upper layers, I could add a
device property on keyboards, but it'd be as (un)friendly as this
approach is to X clients. Besides, on Wayland there aren't many ways to
reach for information from devices...

But In the long run, I agree that this should be responsibility of
whatever process is reading input_event structs (and EV_SW events, if we
are at it :)

  Carlos



More information about the systemd-devel mailing list