Difference between revisions of "Talk:Thinkpad-acpi"

From ThinkWiki
Jump to: navigation, search
(clean talk page)
(Problem with ACPI key event codes in OpenSuse 12.3: new section)
Line 1: Line 1:
 +
== Problem with ACPI key event codes in OpenSuse 12.3 ==
  
 +
 +
The below information was relevant on my Thinkpad Z60m running:
 +
Linux 3.7.10-1.1-desktop
 +
OpenSuse 12.3
 +
KDE 4.10.00 "release 1"
 +
 +
I am currently running:
 +
Linux 3.7.10-1.4-desktop
 +
OpenSuse 12.3
 +
KDE 4.10.2 "release 1"
 +
and everything said below is still valid.
 +
 +
 +
--[[User:Jespergoll|Jespergoll]] ([[User talk:Jespergoll|talk]]) 16:20, 9 May 2013 (CEST)
 +
 +
 +
----
 +
 +
 +
I upgraded my Thinkpad Z60m to OpenSuse 12.3 shortly after its release on March 13th 2013 - and soon found that my ACPI key handling script ({{path|/usr/lib/acpid/thinkpad_handler}}) was broken.
 +
 +
Specifically, they key events reported by the ACPI driver were different from what they had been before the upgrade - and so the following information (in {{path|../Documentation/laptops/thinkpad-acpi.txt}}) '''was no longer true on my system''':
 +
 +
The driver will report HKEY events in the following format:
 +
 +
  ibm/hotkey HKEY 00000080 0000xxxx
 +
 +
Now, instead, the same HKEY events are generally reported in the following format:
 +
 +
button/xxxxx YYY 00000080 00000000 K
 +
 +
- where "xxxxx" is a lowercase name for either the key or the key function, and YYY is a shorter, capitalized version of the same. For example, Fn-F12 ("suspend to disk") is now being reported as:
 +
 +
button/suspend SUSP 00000080 00000000 K
 +
 +
I have found one exception to this general rule: Fn-F7 (the video switch button) is now being reported as:
 +
 +
video/switchmode VMOD 00000080 00000000 K
 +
 +
 +
So I had to rewrite my key handler script ({{path|/usr/lib/acpid/thinkpad_handler}}), and even the event mask (found in {{path|/etc/acpi/events/thinkpad}}). My general key event mask now looks like this:
 +
 +
event=button/.*
 +
action=/usr/lib/acpid/thinkpad_handler "%e"
 +
 +
To get the video switch script back in shape I created an additional event mask ({{path|/etc/acpi/events/video}}) with the following content:
 +
 +
event=video/switchmode
 +
action=/usr/lib/acpid/video_handler "%e"
 +
 +
and moved the video switching routines to a new script: {{path|/usr/lib/acpid/video_handler}}.
 +
 +
 +
Here is a list of the key events I have explored, and the event reports they now produce:
 +
 +
{{key|Fn}}{{key|F1}}     button/fnf1     FNF1   00000080 00000000 K
 +
 +
{{key|Fn}}{{key|F2}}     button/battery   BAT     00000080 00000000 K    {{footnote|1}}
 +
 +
{{key|Fn}}{{key|F3}}     button/screenlock SCRNLCK 00000080 00000000 K    {{footnote|1}}
 +
 +
{{key|Fn}}{{key|F4}}     button/sleep     SBTN   00000080 00000000 K
 +
 +
{{key|Fn}}{{key|F5}}     button/wlan     WLAN   00000080 00000000 K
 +
 +
{{key|Fn}}{{key|F6}}     button/fnf6     FNF6   00000080 00000000 K
 +
 +
{{key|Fn}}{{key|F7}}     video/switchmode VMOD   00000080 00000000 K
 +
 +
{{key|Fn}}{{key|F8}}     button/zoom     ZOOM   00000080 00000000 K    {{footnote|2}}
 +
 +
{{key|Fn}}{{key|F9}}     button/f24       F24     00000080 00000000 K
 +
 +
{{key|Fn}}{{key|F10}}     (not reported)
 +
 +
{{key|Fn}}{{key|F11}}     button/fnf11     FF11   00000080 00000000 K
 +
 +
{{key|Fn}}{{key|F12}}     button/suspend SUSP   00000080 00000000 K
 +
 +
{{ibmkey|ThinkVantage|#495988}} button/prog1     PROG1   00000080 00000000 K
 +
 +
{{key|Fn}}{{key|Space}}  button/zoom     ZOOM   00000080 00000000 K    {{footnote|2}}
 +
 +
{{footnotes|
 +
#Fn-F2 and Fn-F3 seem to have become mixed up in the driver. On my machine, at least, Fn-F2 is "lock" and Fn-F3 is "battery".
 +
#Please note that Fn-F8 and Fn-Space now produce identical event reports - so there is no way to distinguish one from the other.
 +
}}

Revision as of 16:20, 9 May 2013

Problem with ACPI key event codes in OpenSuse 12.3

The below information was relevant on my Thinkpad Z60m running:

Linux 3.7.10-1.1-desktop
OpenSuse 12.3
KDE 4.10.00 "release 1"

I am currently running:

Linux 3.7.10-1.4-desktop
OpenSuse 12.3
KDE 4.10.2 "release 1"

and everything said below is still valid.


--Jespergoll (talk) 16:20, 9 May 2013 (CEST)




I upgraded my Thinkpad Z60m to OpenSuse 12.3 shortly after its release on March 13th 2013 - and soon found that my ACPI key handling script (/usr/lib/acpid/thinkpad_handler) was broken.

Specifically, they key events reported by the ACPI driver were different from what they had been before the upgrade - and so the following information (in ../Documentation/laptops/thinkpad-acpi.txt) was no longer true on my system:

The driver will report HKEY events in the following format:

  ibm/hotkey HKEY 00000080 0000xxxx

Now, instead, the same HKEY events are generally reported in the following format:

button/xxxxx YYY 00000080 00000000 K

- where "xxxxx" is a lowercase name for either the key or the key function, and YYY is a shorter, capitalized version of the same. For example, Fn-F12 ("suspend to disk") is now being reported as:

button/suspend SUSP 00000080 00000000 K

I have found one exception to this general rule: Fn-F7 (the video switch button) is now being reported as:

video/switchmode VMOD 00000080 00000000 K


So I had to rewrite my key handler script (/usr/lib/acpid/thinkpad_handler), and even the event mask (found in /etc/acpi/events/thinkpad). My general key event mask now looks like this:

event=button/.*
action=/usr/lib/acpid/thinkpad_handler "%e"

To get the video switch script back in shape I created an additional event mask (/etc/acpi/events/video) with the following content:

event=video/switchmode
action=/usr/lib/acpid/video_handler "%e"

and moved the video switching routines to a new script: /usr/lib/acpid/video_handler.


Here is a list of the key events I have explored, and the event reports they now produce:

FnF1		    button/fnf1 		    FNF1 	  00000080 00000000 K

FnF2		    button/battery		  BAT	    00000080 00000000 K     1

FnF3		    button/screenlock	SCRNLCK	00000080 00000000 K     1

FnF4		    button/sleep		    SBTN	   00000080 00000000 K

FnF5		    button/wlan		     WLAN	   00000080 00000000 K

FnF6		    button/fnf6		     FNF6	   00000080 00000000 K

FnF7		    video/switchmode	 VMOD	   00000080 00000000 K

FnF8		    button/zoom		     ZOOM	   00000080 00000000 K     2

FnF9		    button/f24		      F24	    00000080 00000000 K

FnF10	    (not reported)

FnF11	    button/fnf11		    FF11	   00000080 00000000 K

FnF12	    button/suspend 		 SUSP	   00000080 00000000 K

ThinkVantage	button/prog1		    PROG1	  00000080 00000000 K

FnSpace   button/zoom		     ZOOM	   00000080 00000000 K     2


FOOTNOTES [Δ]
  1. Fn-F2 and Fn-F3 seem to have become mixed up in the driver. On my machine, at least, Fn-F2 is "lock" and Fn-F3 is "battery".
  2. Please note that Fn-F8 and Fn-Space now produce identical event reports - so there is no way to distinguish one from the other.