hsa2 @ difüzyon If you don't mind, it doesn't matter

31Aug/090

Acer Aspire 5920G Touch Sensitive Buttons and Linux! (a.k.a. nightmare)

I've chosen such a long title because it's the combination of all terms that i searched while eating my fingernails on my keyboard in the middle of the night Smile

I'm writing this document in English because i don't want anybody else in the universe to get mad Razz

I've been researching about this issue for ABOUT 2 YEARS! And finally, after a few days after writing it in archlinux.org forums, someone just linked a ubuntu forum thread. And after following the steps that told in that thread, now I'm able to switch between songs via these buttons on Rhythmbox. Do you want so as well? Keep reading Razz

As first step, create a file, /etc/hal/fdi/policy/20thirdparty/12-x11-acer-media-keys.fdi and paste this in that file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.touchpad">
        <match
key="/org/freedesktop/Hal/devices/computer:system.hardware.vendor"
prefix="Acer">
             <match
key="/org/freedesktop/Hal/devices/computer:system.hardware.product"
string="Aspire 5920G">
                 <match key="info.udi"
string="/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX2_port_logicald
ev_input">
                     <merge key="info.product" type="string">Acer Media
Keys</merge>
                     <merge key="input.product" type="string">Acer Media
Keys</merge>
                 </match>
             </match>
        </match>
    </match>
  </device>
</deviceinfo>

This will set your touch sensitive buttons' device name as 'Acer Media Keys'. After creating and editing this file, you should reboot or at least restart hal with
# /etc/rc.d/hal restart
You can check if it worked by
xinput list|grep id
command.
It should give a output like:

[hsa2@difuzyon][05:08] ~ $ xinput list|grep id
"Virtual core pointer"	id=0	[XPointer]
"Virtual core keyboard"	id=1	[XKeyboard]
"AT Translated Set 2 keyboard"	id=2	[XExtensionKeyboard]
"Macintosh mouse button emulation"	id=3	[XExtensionPointer]
"MLK Trust Mouse 15315"	id=4	[XExtensionKeyboard]
"Acer Media Keys"	id=5	[XExtensionPointer]
"Acer CrystalEye webcam"	id=6	[XExtensionKeyboard]
"Sleep Button"	id=7	[XExtensionKeyboard]
"Power Button"	id=8	[XExtensionKeyboard]
"Video Bus"	id=9	[XExtensionKeyboard]
"Power Button"	id=10	[XExtensionKeyboa

As you can see, on my system it's device with id 5. After doing so, you should edit this device's button-map on each reboot, so i'm recommending to add it to startup applications. This stage is up to you, there is a variety of 'adding applications to startup' documents.
The command that you should run to set button map is that:
xinput set-button-map "Acer Media Keys" 1 2 3 17 18 19 20 8 9 10 11 12 13 14 15 16
After running this command, the button codes of your touch sensitive media buttons will be as:
play button -> 17
stop button -> 18
previous button -> 19
next button -> 20
You can check if it is so by xev. Open a terminal, run xev and push these buttons, it will tell you the button codes that i gave. If not, just stop and re-check.


The rest is easy, define functions for these buttons with these codes. Xbindkeys is my favorite, with the help of xvkbd. Install both, and create a .xbindkeysrc file in your home directory containing:

"xvkbd -text "\[XF86AudioPlay]""
b:17
"xvkbd -text "\[XF86AudioStop]""
b:18:
"xvkbd -text "\[XF86AudioPrev]""
b:19
"xvkbd -text "\[XF86AudioNext]""
b:20

And add xbindkeys as a startup application, too. You know what? It's done Smile They will now behave as real multimedia (play, stop etc.) buttons. You can try them with sonata or rhythmbox, they recognise multimedia buttons as default. If you want to set your euro and dollar keys around your arrow buttons, get this pdf and read it well Razz