Multimedia keyboard howto

So thanks to Crispin
and the people commenting on his blog I at least figured out how
one creates new keyboard profiles for X11.

Step 1: Get the numerical code for the key using the ‘xev’ tool shipping with X

Step 2: Figure out the X11 code by looking up those numbers in /usr/share/X11/xkb/keycodes/xfree86

Step 3: Add a section to /usr/share/X11/xkb/symbols/inet with those codes linking them to relevant XFree86 codes. (make a backup copy first) For my laptop that ended up with:

// Laptop/notebook Dell Inspiron 8xxx
partial alphanumeric_keys
xkb_symbols "inspiron" {
    key <I22>   {       [ XF86AudioPlay, XF86AudioPause ] };
    key <I10>   {       [ XF86AudioPrev         ]       };
    key <I19>   {       [ XF86AudioNext         ]       };
    key <I24>   {       [ XF86AudioStop         ]       };
    key <I30>   {       [ XF86AudioRaiseVolume  ]       };
    key <I2E>   {       [ XF86AudioLowerVolume  ]       };
    key <I20>   {       [ XF86AudioMute         ]       };

Step 4: Then make a unified patch by doing:

diff -u inet inet.backup > inet.patch

Step 5: And finally submit
a bug into the freedesktop bugzilla


#1 Ken on 01.25.06 at 03:43

I have one key that even xev doesn’t respond to. Is it hopeless? Or does this mean that I need to dig around in obscure configuration files (which is pretty much the same thing)? :-)

#2 Christian on 01.25.06 at 07:48

No idea Ken, I guess if Xev doesn’t respond to it simply isn’t registered being pressed at all.

#3 textshell on 01.26.06 at 07:26

If xev doesn’t show the keypresses at all, maybe the kernel is missing information about the keys (as on my laptop)
take a look at the kernel messages and man google for setkeycodes.

I hope that helps ;)

#4 Marius on 01.27.06 at 05:44

I had the very same problem, some keys are not recognized by xev. Check the comments on this blog for a solution:

Whenever you hit a key and see nothing in xev a message is logged to /var/log/messages, using info from the log you will have to map the keycode using setkeycodes.