Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 a Thinkpad Edge E130 running Sabayon (a Gentoo-based distro), and I'm fighting the well-know bug Xorg 255 keycodes limit.

My laptop has the Fn+F4 hotkey for Mic Mute/Unmute. This is the problem:

  • showkey -k shows keycode 248 on Fn+F4 keypress
  • showkey -s shows nothing on keypress
  • xev shows nothing on keypress (because 248+8 [added by kernel] is bigger than 255)

If a key has a keycode, it must have a scancode too. With getscancodes program indeed I got 26 as scancode:

# ./Sabayon/getscancodes/getscancodes /dev/input/event6 
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x17aa product 0x5054 version 0x4101
Input device name: "ThinkPad Extra Buttons"
26 (0x1a)
26 (0x1a)

According to this thread, my guess is simply to change the keycode of the hotkey with a smaller, unused one. For example 120 seems to be unused according to my $ xmodmap -pke

I have tried with

# setkeycodes 0x1a 120

but without success, the keycode is always 248 checking with showkey.

How is the proper way to change keycodes?

share|improve this question
  1. Use showkey to know your key scancode:

    $ sudo showkey -s
    0xe0 0xXX
  2. Kernel will add 8 to you code, use 112 instead 120:

    $ sudo setkeycodes e0XX 112
  3. Use xmodmap to make your key report XF86AudioMute keysym:

    $ xmodmap -e "keycode 120 = XF86AudioMute"
  4. Optional. Press you key when creating shortcut to what you want in the settings of your DE.

share|improve this answer
Actually I switched to Debian Sid and Fn+F4 works out of the box here (maybe just because I have a newer kernel version). But thank you anyway, your solution looks good and I hope will help other people. – ital Sep 26 '14 at 8:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.