Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 never use the <AppsKey> (or <Menu>), and I want to convert it to a modifier key, e.g. Mod4, Mod5, etc. So as to utilize some shortcuts like <Mod5>+<Shift>+J.

Is it possible in Debian/Linux?

share|improve this question
up vote 1 down vote accepted

Pick a free modifier key name such as Hyper or Super (it must not be used by another key). Also pick a free modifier number amongst Mod1 to Mod5. You can figure out the free ones by looking through the output of xmodmap -pke -pm. Also figure out the keycode for the Menu key. Then add lines like the following to ~/.Xmodmap:

keycode 0x75 = Hyper_R
add Mod4 = Hyper_R

If you're not already using a .Xmodmap file, add the following line to your X startup script (maybe ~/.xinitrc or ~/.xsession; some desktop environments automatically read ~/.Xmodmap so you won't need this step):

xmodmap - <~/.Xmodmap
share|improve this answer
A little question, which one should I use in best practice, .xinitrc or .xsession ? – Xiè Jìléi Sep 25 '10 at 0:03
@谢继雷: it's not a matter of best practice: you have to use .xinitrc if you log in in text mode then run startx, and you have to use .xsession if you log in under *dm. If you use your own session script (which is not as common as it used to be: nowadays most people start a desktop environment which has its own way of running commands when you log in), you can arrange for .xsession to contain just . ~/.profile; . ~/.xinitrc. – Gilles Sep 25 '10 at 0:29

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.