Media Keys on Acer Aspire 5920G

The Acer Aspire 5920 has a set of touch-sensitive media buttons on the right hand side of the keyboard, which I’m trying to get working. I used the guide at synaptic touchpad on acer 5920 - two touchpads? - Ubuntu Forums to get them recognised by the system, and after quite a bit of hassle, they are recognised.

Unfortunately they seem to be detected as mouse buttons, which is annoying 'cos they are touch-sensitive and it’s very easy to brush them when typing! Also, I can’t figure out a way of using mouse events to control Amarok.

So, my question is, how do I persuade X to interpret mouse button presses from a specific device as keyboard buttons (ideally I would like them to have the same functionality as the FN+Home/PgUp/PgDn/End buttons, which are apparently mapped to XF86AudioPlay XF86AudioStop etc.)

My first thought was to find out the button ids & use xbindkeys or xmodmap to do the mapping, but xbindkeys -k doesn’t recognise the presses.

The output from xev for a press on the play button is as follows


ButtonPress event, serial 34, synthetic NO, window 0x1000001,
    root 0x103, subw 0x0, time 2787683, (115,136), root:(119,162),
    state 0x0, button 1, same_screen YES

ButtonRelease event, serial 34, synthetic NO, window 0x1000001,
    root 0x103, subw 0x0, time 2787805, (115,136), root:(119,162),
    state 0x100, button 1, same_screen YES

which would be fine if it wasn’t the same as the output for my touchpad & usb mouse! Is there a way of telling xbindkeys/xmodmap to only remap events from a specific device, and if so, how do you identify that device?

My xorg.conf:


Section "ServerLayout"
    Identifier     "Layout[all]"
    Screen         "Screen[0]" 0 0
    InputDevice    "Keyboard[0]" "CoreKeyboard" 
    InputDevice    "Touchpad"
    InputDevice    "USBMouse"
    InputDevice    "AcerMediaKeys"
    Option         "Clone" "off"
    Option         "Xinerama" "off"
EndSection

Section "Files"
  =======TRUNCATED========
EndSection

Section "Module"
    Load           "dbe"
    Load           "type1"
    Load           "freetype"
    Load           "extmod"
    Load           "glx"
EndSection

Section "ServerFlags"
    Option         "AllowMouseOpenFail" "on"
    Option         "ZapWarning" "on"
EndSection

Section "InputDevice"
    Identifier     "Keyboard[0]"
    Driver         "kbd"
    Option         "Protocol" "Standard"
    Option         "XkbLayout" "gb"
    Option         "XkbModel" "microsoftpro"
    Option         "XkbRules" "xfree86"
EndSection

Section "InputDevice"
   Identifier       "TouchPad"
   Driver           "synaptics"
   Option           "CorePointer"
   Option           "Protocol" "event"
   Option          "Device"   "/dev/input/eventtouchpad"
   Option           "MaxTapTime"  "100"
   Option           "MaxTapMove"  "220"
   Option           "AccelFactor"	        "0.05"
   Option           "SHMConfig" "true"
EndSection


Section "InputDevice"
    Identifier     "UsbMouse"
    Driver         "mouse"
    Option         "Buttons" "7"
    Option         "Device" "/dev/input/mice"
    Option         "SendCoreEvents" "true"
    Option         "Name" "Microsoft Trackball Optical"
    Option         "Protocol" "explorerps/2"
    Option         "Vendor" "Sysp"
    Option         "ZAxisMapping" "4 5"
EndSection

Section		"InputDevice"
	Identifier	"AcerMediaKeys"
	Driver		"evdev
	Option        "Device" "/dev/input/eventkeys"
        Option        "SendCoreEvents" "true"
EndSection

Section "Modes"
    Identifier         "Modes[0]"
EndSection

Section "Monitor"
    Identifier     "Monitor[0]"
    VendorName     "--> LCD"
    ModelName      "1280X800@60HZ"
    UseModes       "Modes[0]"
    DisplaySize     332    207
    HorizSync       30.0 - 52.0
    VertRefresh     50.0 - 60.0
    Option         "CalcAlgorithm" "XServerPool"
    Option         "DPMS"
    Option         "PreferredMode" "1024x768"
EndSection

Section "Device"
    Identifier     "Device[0]"
    Driver         "nvidia"
    VendorName     "NVidia"
    BoardName      "GeForce 8600M GS"
EndSection

Section "Screen"
  =======TRUNCATED========
EndSection

Section "Extensions"
    Option         "Composite" "off"
EndSection

Section "Monitor"
  Option       "CalcAlgorithm" "XServerPool"
  DisplaySize  332 207
  HorizSync    30-52
  Identifier   "Monitor[0]"
  ModelName    "1280X800@60HZ"
  Option       "DPMS"
  Option       "PreferredMode" "1280x800"
  VendorName   "--> LCD"
  VertRefresh  50-60
  UseModes     "Modes[0]"
EndSection

Section "Modes"
  Identifier   "Modes[0]"
EndSection

Section "Screen"
  =======TRUNCATED========
EndSection

Section "Device"
  BoardName    "GeForce 8600M GS"
  Driver       "nvidia"
  Identifier   "Device[0]"
  Screen       0
  VendorName   "NVidia"
EndSection

Section "DRI"
    Group      "video"
    Mode       0660
EndSection

Section "Extensions"
  Option       "Composite" "off"
EndSection

Anyone got any ideas?

Welcome to our forum and to openSUSE.

I do not have this laptop, but I wanted to help give you a “warm welcome” by responding to your post.

Are you certain “synaptic” is the approach to follow? I note this URL by a Linux user (not sure which distribution): Init 0: Everything open source where they recommend a simple edit to the /etc/X11/xorg.conf file.

And further to my above post, I notice a slackware user adopted a different approach:
[PHCN] the official Crew - since 1999 - www.phcn.ws](http://www.phcn.ws/main/index.php?path=content/articles.php&contentid=321&PHCN=01f4b676cb2df64d6a62e730a9e3210e)
where they used xbindkeys to get the volume controller and the mail/browser buttons working.

Thanks! Seems using the synaptics driver rather than evdev gives more sensible output… It mapped the play/stop buttons to mouse 4 & 5 (the scrollwheel), and the other two to mouse buttons 6 & 7.

To stop xbindkeys remapping the scrollwheel on my usb mouse, I mapped the Z-Axis to keys 8 & 9, and then used xmodmap to tell the system that these were the scrollwheel up/down buttons.

My final configuration in case anyone else has this problem

/etc/X11/xorg.conf


# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder58)  Thu Jul 17 18:39:00 PDT 2008

# /.../
# SaX generated X11 config file
# Created on: 2008-10-25T18:34:08+0100.
#
# Version: 8.1
# Contact: Marcus Schaefer <sax@suse.de>, 2005
# Contact: SaX-User list <https://lists.berlios.de/mailman/listinfo/sax-users>
#
# Automatically generated by [ISaX] (8.1)
# PLEASE DO NOT EDIT THIS FILE!
#

Section "ServerLayout"
    Identifier     "Layout[all]"
    Screen         "Screen[0]" 0 0
    InputDevice    "Keyboard[0]" "CoreKeyboard" 
    InputDevice    "Touchpad"
    InputDevice    "USBMouse"
    InputDevice    "AcerMediaKeys"
    Option         "Clone" "off"
    Option         "Xinerama" "off"
EndSection

Section "Files"
    InputDevices      "/dev/gpmdata"
    InputDevices      "/dev/input/mice"
    FontPath        "/usr/share/fonts/misc:unscaled"
    FontPath        "/usr/share/fonts/local"
    FontPath        "/usr/share/fonts/75dpi:unscaled"
    FontPath        "/usr/share/fonts/100dpi:unscaled"
    FontPath        "/usr/share/fonts/Type1"
    FontPath        "/usr/share/fonts/URW"
    FontPath        "/usr/share/fonts/Speedo"
    FontPath        "/usr/share/fonts/PEX"
    FontPath        "/usr/share/fonts/cyrillic"
    FontPath        "/usr/share/fonts/latin2/misc:unscaled"
    FontPath        "/usr/share/fonts/latin2/75dpi:unscaled"
    FontPath        "/usr/share/fonts/latin2/100dpi:unscaled"
    FontPath        "/usr/share/fonts/latin2/Type1"
    FontPath        "/usr/share/fonts/latin7/75dpi:unscaled"
    FontPath        "/usr/share/fonts/baekmuk:unscaled"
    FontPath        "/usr/share/fonts/japanese:unscaled"
    FontPath        "/usr/share/fonts/kwintv"
    FontPath        "/usr/share/fonts/truetype"
    FontPath        "/usr/share/fonts/uni:unscaled"
    FontPath        "/usr/share/fonts/CID"
    FontPath        "/usr/share/fonts/ucs/misc:unscaled"
    FontPath        "/usr/share/fonts/ucs/75dpi:unscaled"
    FontPath        "/usr/share/fonts/ucs/100dpi:unscaled"
    FontPath        "/usr/share/fonts/hellas/misc:unscaled"
    FontPath        "/usr/share/fonts/hellas/75dpi:unscaled"
    FontPath        "/usr/share/fonts/hellas/100dpi:unscaled"
    FontPath        "/usr/share/fonts/hellas/Type1"
    FontPath        "/usr/share/fonts/misc/sgi:unscaled"
    FontPath        "/usr/share/fonts/xtest"
    FontPath        "/opt/kde3/share/fonts"
EndSection

Section "Module"
    Load           "dbe"
    Load           "type1"
    Load           "freetype"
    Load           "extmod"
    Load           "glx"
EndSection

Section "ServerFlags"
    Option         "AllowMouseOpenFail" "on"
    Option         "ZapWarning" "on"
EndSection

Section "InputDevice"
    Identifier     "Keyboard[0]"
    Driver         "kbd"
    Option         "Protocol" "Standard"
    Option         "XkbLayout" "gb"
    Option         "XkbModel" "microsoftpro"
    Option         "XkbRules" "xfree86"
EndSection

Section "InputDevice"
   Identifier       "TouchPad"
   Driver           "synaptics"
   Option           "CorePointer"
   Option           "Protocol" "event"
   Option          "Device"   "/dev/input/eventtouchpad"
   Option           "MaxTapTime"  "100"
   Option           "MaxTapMove"  "220"
   Option           "AccelFactor"	        "0.05"
   Option           "SHMConfig" "true"
EndSection


Section "InputDevice"
    Identifier     "UsbMouse"
    Driver         "mouse"
    Option         "Buttons" "9"
    Option         "Device" "/dev/input/mice"
    Option         "SendCoreEvents" "true"
    Option         "Name" "Microsoft Trackball Optical"
    Option         "Protocol" "explorerps/2"
    Option         "Vendor" "Sysp"
    Option         "ZAxisMapping" "8 9"
EndSection

Section		"InputDevice"
	Identifier	"AcerMediaKeys"
	Driver		"synaptics"
	Option        "Device" "/dev/input/eventkeys"
        Option        "SendCoreEvents" "true"
EndSection

Section "Modes"
    Identifier         "Modes[0]"
EndSection

Section "Monitor"
    Identifier     "Monitor[0]"
    VendorName     "--> LCD"
    ModelName      "1280X800@60HZ"
    UseModes       "Modes[0]"
    DisplaySize     332    207
    HorizSync       30.0 - 52.0
    VertRefresh     50.0 - 60.0
    Option         "CalcAlgorithm" "XServerPool"
    Option         "DPMS"
    Option         "PreferredMode" "1024x768"
EndSection

Section "Device"
    Identifier     "Device[0]"
    Driver         "nvidia"
    VendorName     "NVidia"
    BoardName      "GeForce 8600M GS"
EndSection

Section "Screen"
    Identifier     "Screen[0]"
    Device         "Device[0]"
    Monitor        "Monitor[0]"
    DefaultDepth    24
    SubSection     "Display"
        Depth       15
        Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
    EndSubSection
    SubSection     "Display"
        Depth       16
        Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
    EndSubSection
    SubSection     "Display"
        Depth       24
        Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
    EndSubSection
    SubSection     "Display"
        Depth       32
        Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
    EndSubSection
    SubSection     "Display"
        Depth       8
        Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
    EndSubSection
EndSection

Section "Extensions"
    Option         "Composite" "off"
EndSection

Section "Monitor"
  Option       "CalcAlgorithm" "XServerPool"
  DisplaySize  332 207
  HorizSync    30-52
  Identifier   "Monitor[0]"
  ModelName    "1280X800@60HZ"
  Option       "DPMS"
  Option       "PreferredMode" "1280x800"
  VendorName   "--> LCD"
  VertRefresh  50-60
  UseModes     "Modes[0]"
EndSection


Section "Modes"
  Identifier   "Modes[0]"
EndSection


Section "Screen"
  DefaultDepth 24
  SubSection "Display"
    Depth      15
    Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480" 
  EndSubSection
  SubSection "Display"
    Depth      16
    Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480" 
  EndSubSection
  SubSection "Display"
    Depth      24
    Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480" 
  EndSubSection
  SubSection "Display"
    Depth      32
    Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480" 
  EndSubSection
  SubSection "Display"
    Depth      8
    Modes      "1280x800" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480" 
  EndSubSection
  Device       "Device[0]"
  Identifier   "Screen[0]"
  Monitor      "Monitor[0]"
EndSection


Section "Device"
  BoardName    "GeForce 8600M GS"
  Driver       "nvidia"
  Identifier   "Device[0]"
  Screen       0
  VendorName   "NVidia"
EndSection

Section "DRI"
    Group      "video"
    Mode       0660
EndSection

Section "Extensions"
  Option       "Composite" "off"
EndSection

/etc/X11/Xmodmap


!! ~/.Xmodmap
!!

! Squeak?
pointer = 1 2 3 8 9 6 7 4 5

!!
!! End of ~/.Xmodmap

~/.xbindkeysrc


#Map 'e' key to launch amarok
"amarok %U"
    c:159

#Mutlimedia Play/pause:
"xvkbd  -text "\[Control_L]\[Alt_L]\[p]""
    m:0x0 + b:8   (mouse)
#Stop: 
"xvkbd -text "\[Control_L]\[Alt_L]\[s]""
   m:0x0 + b:9    (mouse)
#Multimedia fwd/back:
"xvkbd -text "\[Control_L]\[Alt_L]\[z]""
    m:0x0 + b:6   (mouse)
"xvkbd -text "\[Control_L]\[Alt_L]\[x]"" 
    m:0x0 + b:7    (mouse)

/etc/udev/rules.d/10-acersynaptics.rules


SUBSYSTEMS=="input", ATTRS{phys}=="isa0060/serio4/input0", KERNEL=="event*", NAME="input/eventtouchpad"
SUBSYSTEMS=="input", ATTRS{phys}=="isa0060/serio3/input0", KERNEL=="event*", NAME="input/eventkeys"

And finally a symlink to /usr/bin/xbindkeys in ~/.kde/Autostart

This seems to work perfectly: admittedly the scroll on my touchpad doesn’t work, but that could be easily fixed using the same sort of z-axis change I used with the usb mouse, but seeing as I never use the touchpad anyway, I haven’t bothered fixing this & testing it :stuck_out_tongue:

Thanks for pointing out the synaptics driver by the way, it was the final piece of the puzzle!

Congratulations on sorting this !! And thank you for sharing your solution.