Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

My nephew played with my keyboard and now my S key is out. Is there a way I can change the keyboard layout to attribute the S value to a key I don't use (ie, right Alt)? To make myself crystal clear, is there a way that I can tell Ubuntu that when I press the right Alt, it prints S?

share|improve this question
up vote 3 down vote accepted

You have to add a line to the .xinitrc file in your home folder, or add a command to your startup scripts. This command will remap your keyboard to use a different key for "s".

The command you have to add will look something like this: xmodmap -e 'keycode <value>=<action>'. You have to replace "value" with the key you will press to represent "action" letter. For example, in your case, you want to reassign the letter E to the right Alt key (a guide for all the different key codes is here). I don't know how to assign S to the right Alt key but the Left Alt key is no problem. Make a command like this: xmodmap -e 'keycode 64=s' and add it to your startup scripts.

share|improve this answer
yeah! it worked! The value for Alt-Right did not show in the link you hit me, but after some google, you can just type xmodmap from tty with no args and it will show you special codes for your keyboard. This is what worked for me: xmodmap -e 'keycode 0x6c=s' – francois_rv Dec 22 '11 at 16:00

Try xkeycaps (you may have to install the package, not sure). This suggestion comes from an old forum post

share|improve this answer
the gui is very old school, so I went for solution above but i'll definitely give it a closer look when i'll have the time ;) – francois_rv Dec 22 '11 at 16:01

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.