From: Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
To: linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
gnome-power-manager-list-rDKQcyrBJuzYtjvyW6yDsg@public.gmane.org,
hal-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
desktop_portables-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Untangling the sleep hotkey mess
Date: Sat, 7 Jan 2006 17:24:46 +0000 [thread overview]
Message-ID: <20060107172446.GA3092@srcf.ucam.org> (raw)
Currently, there are three ways that a sleep hotkey may generate an
event:
1) Exposed in DSDT as an ACPI object, generates an ACPI notification
event (the "normal" way)
2) Uses hardware-specific ACPI driver, generates an ACPI notification
event. Not exposed in the DSDT in any standard way (ibm-acpi,
toshiba-acpi, panasonic-acpi)
3) Generates a scancode, which is picked up by the kernel and turned
into a keycode (HP laptops work like this)
This is all quite horribly confusing, and makes life miserable for
userspace. I would like to suggest the following standardisation:
a) Hal should assume that all hardware has a sleep key, since there's no
way to actually tell.
b) Events generated in cases (1) and (2) should, for now, be caught by
acpid (or something similar) and then fed back into the input layer via
uinput. This should be scancode 142, which will end up as X keycode 223.
c) Most keyboards in case (3) will already send scancode 142. For
laptops, those that shouldn't should be remapped at boot time by
checking the system DMI information and consulting a lookup table.
Rationale:
Having one type of event rather than three makes it easier for userspace
coders. Choosing to do it through the input layer lets people take
advantage of pre-existing code for binding userspace events to keyboard
events, and is significantly easier to do than getting keyboard events
back to the ACPI layer. Keycode 142 is chosen because it's what
Microsoft uses, and so most manufacturers who have taken this approach
have copied them.
Future:
1) OSDL have just set up a mailing list
(desktop_portables-qjLDD68F18O7TbgM5vRIOg@public.gmane.org) for discussion of userspace and
laptop interaction. Can I encourage people who are interested in
hammering out cross-distribution solutions to problems like this to
subscribe?
2) /usr/include/linux/input.h defines two keycodes for suspend-type
behaviour: KEY_SLEEP (scancode 142) and KEY_SUSPEND (scancode 205). I'd
like to propose using the second of these for keys that trigger suspend
to disk. There's much less standardisation here, though, so I'd be
interested in hearing what other people think.
--
Matthew Garrett | mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2006-01-07 17:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-07 17:24 Matthew Garrett [this message]
[not found] ` <20060107172446.GA3092-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-07 19:24 ` Untangling the sleep hotkey mess Henrik Brix Andersen
[not found] ` <20060107192444.GA21915-GgQh6P/XBPa901fzNV2Eubv56P54cF3WWmv/VHan8Is@public.gmane.org>
2006-01-07 20:52 ` Matthew Garrett
[not found] ` <20060107205232.GA6445-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-07 21:01 ` Henrik Brix Andersen
[not found] ` <20060107210103.GA5961-GgQh6P/XBPa901fzNV2Eubv56P54cF3WWmv/VHan8Is@public.gmane.org>
2006-01-07 21:14 ` Matthew Garrett
2006-01-08 12:58 ` [gpm] " Richard Hughes
2006-01-08 13:47 ` Matthew Garrett
[not found] ` <20060108134744.GA21538-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-08 14:13 ` Richard Hughes
2006-01-09 1:10 ` Yu Luming
2006-01-09 1:21 ` Richard Hughes
2006-01-09 1:14 ` Richard Hughes
2006-01-09 5:07 ` Dmitry Torokhov
[not found] ` <20060109052407.GA4213@srcf.ucam.org>
[not found] ` <20060109052407.GA4213-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-09 6:09 ` Dmitry Torokhov
[not found] ` <200601090109.05791.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2006-01-09 9:44 ` Richard Hughes
[not found] ` <200601090007.43578.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2006-01-09 5:24 ` Matthew Garrett
2006-01-09 9:43 ` Richard Hughes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060107172446.GA3092@srcf.ucam.org \
--to=mjg59-1xo5oi07kqx4cg9nei1l7q@public.gmane.org \
--cc=desktop_portables-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=gnome-power-manager-list-rDKQcyrBJuzYtjvyW6yDsg@public.gmane.org \
--cc=hal-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox