Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently bought a new keyboard, and it has a lot of unused special keys - like "launch Excel", "launch Word", etc. I suspect there is a way to map the keypresses on those keys to some useful actions (currently, they do absolutely nothing).

How can I do this?


This is the usb keyboard. I found out that while most of the normal keys provide some info via the /dev/input/event2 device, half the normal keys (not catchable by xev) do some action on /dev/input/event3.

And there are other 9 keys that do not do anything on any of the input devices.

share|improve this question
up vote 2 down vote accepted

You'll need to find out what key code those buttons generate. You can do this by using a program called "xev". Once you have the key codes, you can use "xmodmap" to map those key codes to keys (usually function keys) and then use them for key combos in your favorite flavor of desktop manager.

This following link has a good tutorial on doing many of the things you need:

Keep in mind that the KHotKeys portion is KDE specific, so you'll have to adapt it to your particular window manager (GNOME, LXDE, etc...).


Some "special" keys, especially those on "internet" keyboards, don't give a key code because they are generally software driven. Some options for these keys include:



share|improve this answer
There is the problem - most of those special keys print absolutely nothing on "xev" command. And some of the special keys that do work (like mail - it worked out-of-the-box) still print nothing on xev. So seems that something slipped under the radar :) – Rogach Apr 23 '12 at 18:57
@Rogach: Is this a USB keyboard? – Justin Pearce Apr 23 '12 at 19:14
Yes, exactly. Forgot to mention it. – Rogach Apr 23 '12 at 19:18
@Rogach: See my updated answer for more on "special" keys. :D – Justin Pearce Apr 23 '12 at 19:31
Sadly, my keyboard is not supported on that :( – Rogach Apr 23 '12 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .