[systemd-devel] hardware/system keys/buttons

David Herrmann dh.herrmann at googlemail.com
Wed Dec 26 08:31:36 PST 2012


Hi Tormen

On Wed, Dec 26, 2012 at 4:25 PM, Tormen <quickhelp at gmail.com> wrote:
> Aargh! I tried to be clear ... and was not ;)
>
>
>> I would like to trigger events on my notebook hardware keys and
>> independent of any X environment!
>
> I would like to react to input events [triggered by hardware keys] on my
> notebook
> and this independent of any X environment.

The problem that you will encounter here is that this mechanism will
only work for keycodes. That is, you can react on the code that is
associated with the physical key. If you want to react on keysyms
(which is probably what most people want), you need keyboard handling
(like XKB, xkbcommon, KBD). However, this will become very complex and
you want different keyboard-layouts to be configured etc...
Hence, in my opinion integrating this into systemd won't simplify this
in any way. Listening via udev on event devices and opening them via
/dev/input/eventX should be fairly straightforward.

Furthermore, how would you like this to be implemented? Should systemd
spawn one client every time a configured key is pressed? Doesn't sound
very efficient to me.

I also want a daemon that can react on key-presses independent of
xserver, but I haven't found any nice way to provide this but
listening for key-presses in the application itself. Every other idea
I had is either inefficient or ugly.
So maybe a library providing such functionality is the best idea?

Regards
David


More information about the systemd-devel mailing list