[systemd-devel] Suspend from wireless keyboard not working

Gustavo De Nardin (spuk) gustavodn at gmail.com
Fri Feb 13 20:34:53 PST 2015


Thanks, it worked. Just had to do some debugging to learn the correct
action for suspend is 'sleep', while 'suspend' is for hibernate. :]

Excuse the ignorance, but why is it a problem if every keyboard would get
the 'power-switch' tag (or if it wouldn't be needed)? For example, would it
be a problem if a distro adds the power-switch tag to all keyboards by
default? If the kernel is in a sleep state, how would it matter to filter
such events? Or is the idea for it to be able to filter such events
immediately after being awoken and then get back to the sleep state?

t'


On 13 February 2015 at 07:46, Lennart Poettering <lennart at poettering.net>
wrote:

> On Fri, 13.02.15 00:46, Gustavo De Nardin (spuk) (gustavodn at gmail.com)
> wrote:
>
> > Hello.
> >
> > I'm trying to make my notebook (Lenovo Thinkpad X230) suspend when
> pressing
> > the "sleep" extra key on a wireless keyboard (Logitech K270 using the
> > Logitech unifying receiver).
> >
> > I've been able to map the "sleep" key to the 'pauseplay' action in a
> > '/etc/udev/hwdb.d/70-keyboard.hwdb' file, for testing, and it works (as
> > pause/play, of course), but when I map it to 'suspend', nothing happens.
> > Pressing the "suspend" key on the notebook's own keyboard works as
> expected
> > ("out of the box", no messing from my part).
> >
> > I'm running Arch Linux, systemd-218-1, no desktop environment, just
> > WindowMaker. /etc/logind.conf has HandleSuspendKey on default
> > ('#HandleSuspendKey=suspend').
> >
> > I also just learned from /usr/share/doc/systemd/NEWS that since v210
> logind
> > won't suspend when the notebook has the lid closed and is on a docking
> > station, which is my case. But even testing with lid open and out of the
> > dock, it won't suspend from the wireless keyboard.
> >
> > What else would be needed? Where/what should I look for?
>
> logind only listens to keypresses of keyboards that carry the udev tag
> "power-switch". It will ignore all others. By default only the buttons
> from ACPI devices and certain special laptop input drivers are marked
> like that.
>
> I'd like to open this up for all keyboards by default, but I don't
> want to do that unless we can get patches into the kernel that allow
> us to suppress wakeups for any key events but the ones we really care
> about.
>
> David Herrmann has been posting patches about this, but so far that
> lead to very little:
>
>
> http://markmail.org/message/3omuwwapmfnrwit5#query:+page:1+mid:5v54axmwgteur67z+state:results
>
> As a local fix to make this work for you you can write a udev rule
> that adds the "power-switch" tag to your keyboard.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>



-- 
(nil)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150214/bfb08d33/attachment-0001.html>


More information about the systemd-devel mailing list