Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How are Fn-F# ACPI events mapped?
Date: Fri, 16 Mar 2012 17:08:57
Message-Id: CAK2H+edGRbdEMphgUxtGOzCMbcxhxPcmQS6=L_E2+Libw1ej6g@mail.gmail.com
In Reply to: Re: [gentoo-user] How are Fn-F# ACPI events mapped? by YoYo Siska
1 On Tue, Mar 13, 2012 at 5:27 AM, YoYo Siska <yoyo@××××××.sk> wrote:
2 > On Sun, Mar 11, 2012 at 03:23:28PM -0700, Mark Knecht wrote:
3 >> Hi,
4 >>    I'm trying to figure out how my Asus laptop maps function key
5 >> events. This is being driven by an emerge message telling me that the
6 >> acpi4asus package is being obsoleted and removed in 30 days and
7 >> replaced by an in-kernel driver. I've removed the package and rebuilt
8 >> my kernels to use this driver, and for vanilla-sources-3.2.7 the
9 >> results are similar as with the acpi4asus package.
10 >
11 > don't know anything about the assus packages/drivers, but the general
12 > direction in all such drivers is to move these things where they belong:
13 > to the input subsystem, so my guess is the new driver doesn't produce
14 > acpi events, but insted create a "input device" and produce key
15 > press/release events on that device...
16 >
17 > (note that sleep / hibernate actions are usually still reported also
18 > throgh acpi, because some programs expect them to come from there, that
19 > would explaing your Fn-F1/sleep working)
20 >
21 > to test this, just run as root on the linux console (not in a termnal in
22 > X):
23 >
24 > showkey -s
25 >
26 > and then pres the keys (ie Fn-F4,) to stop showkeys, just don't press
27 > anything for 10 seconds...
28 > if you see numbers appearing after each keypress / release, then the key
29 > directly generates keyboard ivents  and its possible you will see them
30 > directly in X, for that jus run (now under X)
31 >
32 > xev
33 >
34 > and (the window that appears must have focus / be active) press the keys
35 > again, xev will print the X keycodes/keysyms to its output...
36 > if you see reasonable names there, then you should be able to map those
37 > keys in the programs you are using (ie global hotkeys in kde, etc...)
38 > note however that qt/kde doesn't recognise some of the more exotic
39 > keysyms...  (in my case XF86TouchpadToggle produced by Fn-F8 on
40 > thinkpads ;)
41 >
42 > if you can see the key in showkey -s  but not in xev, the problem might
43 > be in kernel keyboard map (though i'm not sure if the x's evdev driver
44 > uses that) or in the evdev driver not mapping that key
45 >
46 > basically the kernel driver reports scan codes (what showkey -s shows),
47 > kernel translates that to keycodes (showkey -k to see them) and then X's
48 > input driver (ie evdev) translates those to the X keycodes X server
49 > again trasnlates them to keysym-s....
50 >
51 > yoyo
52 >
53
54 Hi,
55 Sorry about the late reply. I messed with this a few days ago but
56 never wrote to say thanks. My bad.
57
58 Basic outcome - there seemed to be three things I learned:
59
60 1) The basic message architecture, thanks to your post. Thanks for that.
61
62 2) There is some problem with vanilla-sources-3.2.9 which is
63 apparently fixed in 3.2.10. Thanks to kernel devs I suppose for that.
64 Almost all the function keys now produce some sort of message in
65 acpi_listen, showkey & xev.
66
67 3) The function I seem to be missing at this point is being able to
68 actually control the brightness of keyboard backlights. I can do this
69 in Windows but not in Linux. However I don't know yet if Linux even
70 has a driver with that capability so I'll have to spend some time
71 looking for that over the weekend.
72
73 Again, thanks for the response. It was quite helpful.
74
75 Cheers,
76 Mark