Ubuntu – Change keyboard value


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?

Best Answer

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.

Related Question