Enabling Media Keys on the Saitek Eclipse II Keyboard (Ubuntu 8.04 and most other Linux distros)
Monday, June 23, 2008
One of the few problems I experienced in my recent fresh install of Ubuntu 8.04 (Hardy Heron) was the non-functionality of the media keys on my Saitek Eclipse II keyboard. This problem came as quite the odd surprise, seeing as the keys worked great in 7.04 and 7.10. It has always been puzzling to me that a new release can actually take a step backwards in terms of device compatibility... but what do I know? I don't code it, so it must be harder than it looks.
Either way, I soon set out to find a solution for this irksome issue I had on my hands. Who would have guessed that salvation came in the form of a Gentoo wiki page? Nice eh? Well, if you have explored that link a bit, you may note that it is quite lengthy and perhaps just a tad confusing for the Linux newbie. So... I bring you my simplified version! I have taken only the essential steps that were required to get the media keys on my Saitek Eclipse II keyboard working. I am sure that the guide works for other keyboards as well.
The first step of this process is find the raw scancodes that the kernel spits out and X interprets when a key is pressed. To do this in a nice, simple fasion, issue the following command and press the keys you would like to configure in an order that you can remember:
Close the window when you are done. There should be an out put left that looks somewhat like so:
The first line isn't actually a media key, so just ignore/ delete it.
Now, we must set up xmodmap to recognize the keys and assign them their proper keysyms. In your home directory, create a file named .Xmodmap. In this file, you will enter the appropriate keysysm to match the media key. My file ended up looking like this:
You can find all possible keysyms listed in the following file on Ubuntu: /usr/share/X11/XKeysymDB.
This should now all be automatically loaded at startup. If it doesn't... try:
Now that we have the keys properly identified and configured, we can assign them to the actions of our choice. I like to have my keys set up in Amarok, so I set the to their respective functions under Settings > Configure Global Shortcuts. You can also set the keys through gnome by going to System > Preferences > Keyboard Shortcuts. However, in the past, I have noted that this can cause conflict with Amarok, so I usually just leave the keys disabled in the Keyboard Shortcuts dialog (Amarok will handle them just fine that way).
If all went well, that should get you full support for you mutlimedia keys in Ubuntu and Amarok. If it doesn't work, then take a look around the wiki page... maybe you will find something that fixs the issue or (even better) inspires you to come up with your own hacks and workarounds :D
Have fun!
Note from the Nerd: Many thanks to the people who contributed to the Gentoo wiki page I have so extensively referenced in this post!
Either way, I soon set out to find a solution for this irksome issue I had on my hands. Who would have guessed that salvation came in the form of a Gentoo wiki page? Nice eh? Well, if you have explored that link a bit, you may note that it is quite lengthy and perhaps just a tad confusing for the Linux newbie. So... I bring you my simplified version! I have taken only the essential steps that were required to get the media keys on my Saitek Eclipse II keyboard working. I am sure that the guide works for other keyboards as well.
The first step of this process is find the raw scancodes that the kernel spits out and X interprets when a key is pressed. To do this in a nice, simple fasion, issue the following command and press the keys you would like to configure in an order that you can remember:
xev | sed -n s/"^.*keycode *\([0-9]\+\).*$"/"keycode \1 = "/p | uniq
Close the window when you are done. There should be an out put left that looks somewhat like so:
keycode 36 =
keycode 144 =
keycode 162 =
keycode 164 =
The first line isn't actually a media key, so just ignore/ delete it.
Now, we must set up xmodmap to recognize the keys and assign them their proper keysyms. In your home directory, create a file named .Xmodmap. In this file, you will enter the appropriate keysysm to match the media key. My file ended up looking like this:
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
You can find all possible keysyms listed in the following file on Ubuntu: /usr/share/X11/XKeysymDB.
This should now all be automatically loaded at startup. If it doesn't... try:
/usr/bin/xmodmap $HOME/.Xmodmap
Now that we have the keys properly identified and configured, we can assign them to the actions of our choice. I like to have my keys set up in Amarok, so I set the to their respective functions under Settings > Configure Global Shortcuts. You can also set the keys through gnome by going to System > Preferences > Keyboard Shortcuts. However, in the past, I have noted that this can cause conflict with Amarok, so I usually just leave the keys disabled in the Keyboard Shortcuts dialog (Amarok will handle them just fine that way).
If all went well, that should get you full support for you mutlimedia keys in Ubuntu and Amarok. If it doesn't work, then take a look around the wiki page... maybe you will find something that fixs the issue or (even better) inspires you to come up with your own hacks and workarounds :D
Have fun!
Note from the Nerd: Many thanks to the people who contributed to the Gentoo wiki page I have so extensively referenced in this post!
1
Comments:
The Spanish blog is systematically organized into a menu and comes across as a user-friendly and easy to browse site. No surprises that the blog has more than 950 readers and encourages readers to actively participate in the enrichment of the blog by participating in the forums and submitting any latest stories up their sleeves.IE AntiVirus
commented by Unknown, 6:34 AM