[Pkg-acpi-devel] Bug#521280: doesn't seem to affect thinkpad-acpi only

Harald Braumann harry at unheit.net
Mon Oct 19 15:35:33 UTC 2009


Hi,

acpid in principle supports button events from the input layer. The
problem is just, that the necessary events are not defined. This is
from Debian's acpid (1.0.10-2) in file input_layer.c:

static struct evtab_entry evtab[] = {
        {{{0,0}, EV_KEY, KEY_POWER, 1}, "button/power PBTN 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_SLEEP, 1}, "button/sleep SBTN 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_SUSPEND, 1}, 
                "button/suspend SUSP 00000080 00000000"},
        {{{0,0}, EV_SW, SW_LID, 1}, "button/lid LID close"},
        {{{0,0}, EV_SW, SW_LID, 0}, "button/lid LID open"}
};

I've recorded all the button events when the Fn key is pressed on my
Thinkpad T42p and also merged events found in the version here:
http://www.tedfelix.com/linux/acpid-netlink.html

With these additions, acpid is able to listen to all Fn button events.
So acpid should be patched to include these:

static struct evtab_entry evtab[] = {
	{{{0,0}, EV_KEY, KEY_POWER, 1}, "button/power PBTN 00000080 00000000"},
	{{{0,0}, EV_KEY, KEY_SLEEP, 1}, "button/sleep SBTN 00000080 00000000"},
	{{{0,0}, EV_KEY, KEY_SUSPEND, 1}, "button/suspend SUSP 00000080 00000000"},
	{{{0,0}, EV_SW, SW_LID, 1}, "button/lid LID close"},
	{{{0,0}, EV_SW, SW_LID, 0}, "button/lid LID open"},
        /* blue access IBM button on Thinkpad T42p*/
        {{{0,0}, EV_KEY, KEY_PROG1, 1}, "button/prog1 PROG1 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_VENDOR, 1}, "button/vendor VNDR 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_FN_F1, 1}, "button/fnf1 FNF1 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_FN_F2, 1}, "button/fnf2 FNF2 00000080 00000000"},
        /* Fn-F2 produces KEY_BATTERY on Thinkpad T42p */
        {{{0,0}, EV_KEY, KEY_BATTERY, 1}, "button/battery BAT 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_SCREENLOCK, 1}, "button/screenlock SCRLCK 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_COFFEE, 1}, "button/coffee CFEE 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_SLEEP, 1}, "button/sleep SBTN 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_WLAN, 1}, "button/wlan WLAN 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_FN_F6, 1}, "button/fnf6 FNF6 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_SWITCHVIDEOMODE, 1}, "button/videomode VMOD 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_FN_F9, 1}, "button/fnf9 FNF9 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_FN_F10, 1}, "button/fnf10 FNF10 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_FN_F11, 1}, "button/fnf11 FNF11 00000080 00000000"},
        /* Fn-F9 produces KEY_F24 on Thinkpad T42p */
        {{{0,0}, EV_KEY, KEY_F24, 1}, "button/fnf24 FNF24 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_SUSPEND, 1}, "button/suspend SUSP 00000080 00000000"},
        {{{0,0}, EV_MSC, 4, 12}, "button/fnbs FNBS 00000080 00000000"},
        {{{0,0}, EV_MSC, 4, 13}, "button/fnins FNINS 00000080 00000000"},
        {{{0,0}, EV_MSC, 4, 14}, "button/fndel FNDEL 00000080 00000000"},
        {{{0,0}, EV_MSC, 4, 18}, "button/fnpgdown FNPGDOWN 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_ZOOM, 1}, "button/zoom ZOOM 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_BRIGHTNESSDOWN, 1}, "button/brightnessdown BRTDN 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_BRIGHTNESSUP, 1}, "button/brightnessup BRTUP 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_KBDILLUMTOGGLE, 1}, "button/kbdillumtoggle KBILLUM 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_VOLUMEDOWN, 1}, "button/volumedown VOLDN 00000080 00000000"},
        {{{0,0}, EV_KEY, KEY_VOLUMEUP, 1}, "button/volumeup VOLUP 00000080 00000000"},
        /* mute button produces KEY_MIN_INTERESTING on Thinkpad T42p */
        {{{0,0}, EV_KEY, KEY_MIN_INTERESTING, 1}, "button/mininteresting MININT 00000080 00000000"}
};

Other models might produce different events. They can all be found with
`input-events' from the input-utils package. To find the device to
listen on, call lsinput and look for the right one. For instance mine
shows:

# lsinput
...
/dev/input/event6
   bustype : BUS_HOST
   vendor  : 0x1014
   product : 0x5054
   version : 16641
   name    : "ThinkPad Extra Buttons"
   phys    : "thinkpad_acpi/input0"
   bits ev : EV_SYN EV_KEY EV_MSC
...

So I would call `input-events 6'

Cheers,
harry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20091019/3b92e4f5/attachment.pgp>


More information about the Pkg-acpi-devel mailing list