In this article I will show you how to get your Logitech Media Keyboard Elite's multimedia keys functional and configured for use within the Openbox window manager.
The Media Keyboard Elite has four keys which need to have their key codes manually setup in order to work. These are the side zoom keys and the messenger key.

1. Setting up your keycodes.
Before we can do anything we need to edit your local multi-user start-up script and configure the key codes for some keys.
This can be done by editing your /etc/rc.local file as root and adding the following:
setkeycodes e004 132 # Messenger key
setkeycodes e05a 218 # Mode F button
# Zoom Keys
setkeycodes 6b 235 # 100% key
setkeycodes 6a 234 # - Zoom key
setkeycodes e011 145 # + Zoom key
# Function Keys with Mode F off
setkeycodes e03b 187 # F1
setkeycodes e03c 188 # F2 - Word
setkeycodes e03d 189 # F3 - Excel
setkeycodes e03e 190 # F4 - Finance
setkeycodes e03f 191 # F5 - Undo
setkeycodes e040 192 # F6 - Redo
setkeycodes e041 193 # F7 - Print
setkeycodes e042 194 # F8 - Save
setkeycodes e043 195 # F9 - "Programmable A"
setkeycodes e044 196 # F10 - "Programmable B"
setkeycodes e057 215 # F11 - "Programmable C"
setkeycodes e058 216 # F12 - "Programmable D"
Once this is done, save the file and either reboot or run sh /etc/rc.local from your terminal to activate your changes.
2. Setting up your multimedia keys.
To set up your multimedia keys, you will need to edit a line in your xorg.conf file as root.
Look for the InputDevice section of the file and update the XkbModel line so it looks exactly like the following:
Option "XkbModel" "logiclx300"
After restarting X your media keys should now be detected.
Now that the multimedia keys are working, we will move onto creating a file that will map the messenger, zoom, and function key codes to their keysyms which identifies the symbolic name of each key on your keyboard.
This is done by creating or editing a file called .Xmodmap in your home directory and adding the following:
keycode 240 = XF86Go # This is the 100% Key.
keycode 140 = XF86ZoomOut
keycode 213 = XF86ZoomIn
keycode 199 = XF86Messenger
# Function keys
keycode 194 = XF86Launch0 # Mode F
keycode 131 = XF86Support
keycode 247 = XF86Word
keycode 132 = XF86Excel
keycode 170 = XF86Finance
keycode 219 = XF86Undo
keycode 249 = XF86Redo
keycode 205 = XF86Print
keycode 207 = XF86Save
keycode 149 = XF86LaunchA
keycode 150 = XF86LaunchB
keycode 120 = XF86LaunchC
keycode 121 = XF86LaunchD
Next edit your .xinitrc or .xsession file and insert xmodmap ~/.Xmodmap & towards the top of the file.
Configuration Variant:
If for some odd reason the keys were not detected and you have verified your above changes, you can append the following to your .Xmodmap in order to get them working.
keycode 160 = XF86AudioMute
keycode 161 = XF86Calculator
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 178 = XF86WWW
keycode 223 = XF86Sleep
keycode 230 = XF86Favorites
keycode 236 = XF86Mail
keycode 237 = XF86AudioMedia
3. Configure Openbox to use your media keys.
The final step is configuring Openbox to use your newly configured media keys. This can be done by editing your ~/.config/openbox/rc.xml file and adding the following. This is my personal configuration so please change the applications to your preference.
This example has not set up the function keys.
<keybind key="XF86Calculator">
<action name="Execute"><execute>gcalctool</execute></action>
</keybind>
<keybind key="XF86WWW">
<action name="Execute"><execute>galeon</execute></action>
</keybind>
<keybind key="XF86Mail">
<action name="Execute"><execute>urxvt -g 100x44 -e mutt</execute></action>
</keybind>
<keybind key="XF86Messenger">
<action name="Execute"><execute>urxvt -g 100x44 -e centericq</execute></action>
</keybind>
<keybind key="XF86AudioMedia">
<action name="Execute"><execute>mpd</execute></action>
</keybind>
<keybind key="XF86AudioPlay">
<action name="Execute"><execute>mpc toggle</execute></action>
</keybind>
<keybind key="XF86AudioStop">
<action name="Execute"><execute>mpc stop</execute></action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute"><execute>mpc toggle</execute></action>
</keybind>
<keybind key="XF86AudioRaiseVolume">
<action name="Execute"><execute>mpc volume +10</execute></action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute"><execute>mpc volume -10</execute></action>
</keybind>
<keybind key="XF86AudioNext">
<action name="Execute"><execute>mpc next</execute></action>
</keybind>
<keybind key="XF86AudioPrev">
<action name="Execute"><execute>mpc prev</execute></action>
</keybind>
<!-- These are the Zoom keys on the left. I use them to launch rox and switch between virtual desktops -->
<keybind key="XF86Go">
<action name="Execute"><execute>thunar</execute></action>
</keybind>
<keybind key="XF86ZoomIn">
<action name="DesktopNext"/>
</keybind>
<keybind key="XF86ZoomOut">
<action name="DesktopPrev"/>
</keybind>
Finally, save the file and reconfigure Openbox when you are done making your changes to activate your changes.
If you have any questions or comments, please feel free to post them on this page.








Comments
How do you determine
How do you determine scancodes for the side zoom keys and the messenger key in /etc/rc.local?
When you press down on a key
When you press down on a key that lacks a mapped keycode an unknown key error is logged which you can view with dmesg.
You take the resulting code in that error and convert it into a key code by using the last two digits of the code it gives you (it will look something like "code 0x6b") and converting it from hex to decimal then adding 128 to the resulting value.
6b would convert to 107 and when you add 128 you get the final code of 235.
I hope that helps you out
I just use xev to find
I just use xev to find keycode then bind to a F key .... same but different (great howto btw ;-))
Keys do not show up. -- Please try it out with your keyboard.
I have also bought this keyboard--although I would not do it again, seeing that Logitech puts no effort in supporting GNU/Linux and according to [1] Comment #14 their devices are even broken/non-standard.
Anyway, my problem is that pressing the keys Zoom In, Zoom Out, Zoom Reset, Messenger, F-Mode I do not get any events with sudo showkey under a Debian unstable system with a 2.6.18 kernel. Your setkeycodes commands do not change anything either.
Using a 2.6.20-1-686 linux kernel I get events for the Zoom In, Zoom Out, Messenger, F-Mode keys, but not for the Zoom Reset key. And strangely sudo showkey shows up the following (I left out the keypresses for the function key with enabled Mode F.)
0x00 0x83 0xae
0x80 0x83 0xae
0x00 0x82 0x8f
0x80 0x82 0x8f
0x00 0x83 0xa3
0x80 0x83 0xa3
0x00 0x83 0xa2
0x80 0x83 0xa2
but sudo showkey -s does not print anything. And executing your setkeycodes with sudo gives
sudo setkeycodes 6b 235
KDSETKEYCODE: Kein passendes Gerät gefunden -- Translation: No suitable device found
failed to set scancode 6b to keycode 235
Using a self compiled 2.6.21.1 linux vanilla kernel with DEBUG Mode turned on for HID, all keys but the Zoom Reset key show events, e. g. for the Mode F key.
Apr 28 14:30:58 mattotaupa kernel: hid-debug: input Button.0040 = 1
Apr 28 14:30:58 mattotaupa kernel: hid-debug: input Button.0040 = 0
But the showkey and setkeycodes behaviour is the same as before. Therefore xev does not work in all three cases either.
So if you still have that keyboard, could you please tell me,
- if it is still working for you
- what linux kernel version you are using and
- if the keyboard is connected over the USB bus.
Thank you a lot.
PS: You do not need to set most of the keys, as the model logiclx300 has some of them mapped correctly. Just edit your xorg.conf file and change the model for your input device [2].
PPS: The keyboard is fine, since it works under M$ Windows XP.
[1] http://bugme.osdl.org/show_bug.cgi?id=7352
[2] https://bugs.freedesktop.org/show_bug.cgi?id=7893
Logitech
Hi there.
I actually no longer use the Logitech Media Keyboard Elite as I went back to my trusty IBM Model M keyboard.
I had given the keyboard away to my parents awhile back, but I went over and borrowed it today so I could assist you.
It would seem that all the keys work flawlessly when the scan codes from this tutorial are used and the keyboard is connected via the PS/2 port.
However, once I switched it over to a USB connection the keys once again did not register and I did not see any unknown key errors in my dmesg output which is something I would have expected to see.
As for your other question, my kernel is currently 2.6.20.7
Logitech Media Keyboard Elite
Thank you for your effort.
Could you please also answer the following to questions?
1. So am I understanding this correctly, that the 2.6.20.7 linux kernel was not aware of the four keys?
2. Did you also try the Fx (x = 1, ..., 12) with the Mode F turned on/off?
3. Did the logiclx300 model in xorg.conf map the keys correctly?
Thanks a lot.
Keyboard Results
Everything works perfectly when the keyboard is connected via a PS/2 port.
I set up some key codes and have working function keys with Mode F turned off.
The problem with the keys only seem to occur when the keyboard is connected via USB.
I tested the keyboard with logiclx300. It seems that all the media keys were detected with the sole exception of our four trouble keys.
In addition, only four function keys work (via key codes) when Mode F is turned off.
The function keys that were not detected are F2,F3, and F9-F12.
I have updated the article with the function key codes and a notice about this on going issue.
Re: Configuring The Logitech Media Keyboard Elite's Multimedia K
Thank you very much. Really useful.
Re: Configuring The Logitech Media Keyboard Elite's Multimedia K
No problem. I am glad that it was of use to you. :)
Re: Configuring The Logitech Media Keyboard Elite's Multimedia K
Hi guys i just found a new software for linux providing support for the Logitech devices. check out http://www.hidpoint.com
hope this helps.
Re: Configuring The Logitech Media Keyboard Elite's Multimedia K
HIDpoint seems good but it's useless. With no smp support I can't even dream installing it.
And what about 64bit support? Welcome to the 2000's.
What distribution are you running? I run opensuse 11.0 and there is no such file /etc/rc.local So I don't really have a clue where I should write excatly what