[Pkg-acpi-devel] Bug#521280: how to make acpid react to hotkeys now?

gregor herrmann gregoa at debian.org
Thu Apr 16 14:41:00 UTC 2009


On Wed, 15 Apr 2009 20:32:41 -0300, Henrique de Moraes Holschuh wrote:

> > However, no matter how hard I try, I cannot figure out how to make
> > my system react to Fn-FX keypresses on the Thinkpad X40.
> You can use a HAL .fdi file to set a X-friendly keycode for the
> thinkpad-acpi scan map positions 0x00 (fn+f1), 0x01 (fn+f2).

Here's what I'm doing, maybe it helps others:

#v+
gregoa at nerys:~$ cat /etc/hal/fdi/information/thinkpad-keymap.fdi
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">
  <device>
    <!-- These are buttons synthesized in the thinkpad-acpi kernel module -->
    <!-- http://people.freedesktop.org/~hughsient/quirk/quirk-keymap-modules-data.html#thinkpad -->
    <match key="input.product" string="ThinkPad Extra Buttons">
      <match key="/org/freedesktop/Hal/devices/computer:system.hardware.vendor" prefix="LENOVO">
        <!-- Fn+F6 -->
        <!-- KEY_FN_F6 0x1d7 -->
        <!-- KEY_F16 186 -->
        <append key="input.keymap.data" type="strlist">0x05:f16</append>
        <!-- Fn+F8 -->
        <!-- KEY_FN_F8 0x1d9 -->
        <!-- KEY_F18 188 -->
        <append key="input.keymap.data" type="strlist">0x07:f18</append>
        <!-- Fn+F9 -->
        <!-- KEY_FN_F9 0x1da -->
        <!-- KEY_F19 189 -->
        <append key="input.keymap.data" type="strlist">0x08:f19</append>
        <!-- Fn+F10 -->
        <!-- KEY_FN_F10 0x1db -->
        <!-- KEY_F20 190 -->
        <append key="input.keymap.data" type="strlist">0x09:f20</append>
        <!-- Fn+F11 -->
        <!-- KEY_FN_F11 0x1dc -->
        <!-- KEY_F21 191 -->
        <append key="input.keymap.data" type="strlist">0x0a:f21</append>
        <!-- Fn+Space -->
        <!-- KEY_ZOOM 0x174 -->
        <!-- KEY_PROG2 149 -->
        <append key="input.keymap.data" type="strlist">0x13:prog2</append>
        <!-- Volume Up button -->
        <!-- KEY_VOLUMEUP 115 -->
        <append key="input.keymap.data" type="strlist">0x14:volumeup</append>
        <!-- Volume Down button -->
        <!-- KEY_VOLUMEDOWN 114 -->
        <append key="input.keymap.data" type="strlist">0x15:volumedown</append>
        <!-- Mute button -->
        <!-- KEY_MUTE 113 -->
        <append key="input.keymap.data" type="strlist">0x16:mute</append>
        <!-- ThinkPad/ThinkVantage -->
        <!-- KEY_VENDOR 0x168 -->
        <!-- KEY_PROG1 148 -->
        <append key="input.keymap.data" type="strlist">0x17:prog1</append>
        <append key="info.capabilities" type="strlist">input.keymap</append>
      </match>
    </match>
  </device>
</deviceinfo>

#v-

The other Fn-FX keys work for me (except Fn-F1 but I forgot what I
did/not try about it).

In the above file the three volume-stanzas are probably useless; the
volume-key-events show up for me only after reinstalling
hotkey-setup, maybe there's another possibility, too.

Oh, and as per #504643 I've diverted "away"
/usr/share/hal/fdi/information/10freedesktop/30-keymap-module-thinkpad-acpi.fdi
before.

While we're here that's how I got back the scrolling ability for the
trackpoint (found somewhere on the intarwebs):

#v+

gregoa at nerys:~$ cat /etc/hal/fdi/policy/mouse-wheel.fdi 
<match key="info.product" string="TPPS/2 IBM TrackPoint">
 <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
 <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
 <merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
 <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
 <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
 <merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
</match>

#v-
 
> > How am I supposed to react to these events nowadays?
> Well, the very best would be to improve the hal input event helper to make
> it grow generic "hey, do this configurable thing when you get this
> configurable input event" functionality, then use that.  I don't have time
> to tack that in the near future :-(

I'm using xbindkeys at the moment, but something that's independent
from X and a specific user would indeed be nice. Unfortunately I
haven't found out yet if and how HAL can call events on keypresses
... 

Cheers,
gregor 
-- 
 .''`.   Home: http://info.comodo.priv.at/{,blog/} / GPG Key ID: 0x00F3CFE4
 : :' :  Debian GNU/Linux user, admin, & developer - http://www.debian.org/
 `. `'   Member of VIBE!AT, SPI Inc., fellow of FSFE | http://got.to/quote/
   `-    NP: Beatles
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20090416/c0cfe6c2/attachment.pgp>


More information about the Pkg-acpi-devel mailing list