Human Readable   

 

     
   
     

A Slackware Desktop Enhancement Guide

Configuring the Right Alt Key The Same As The Left Alt Key

© Copyright Darrell Anderson.

Although with hindsight I now understand the design philosophy, one aspect of GNU/Linux that disgruntled me from my beginning days of using GNU/Linux was that outside of KDE the Right Alt key did not work the same as the Left Alt key. This frustrated me because I use an old but faithful Northgate Omnikey Ultra-T keyboard and the primary functions keys are located on the left side of the keyboard. Additional functions keys are located at the top of the keyboard and I modify those keys to act as Shift-Fn keys. I have small hands and using the Left Alt key was always awkward with one hand. Through the many years I have been using this keyboard, I developed a habit of using two hands to invoke function key commands by using the Right Alt key.

Standard GNU/Linux design assigns a different function to the Right Alt key called the AltGr function. This function is for people who need a special modifier key to toggle between different keymaps for different languages. Certainly a handy feature for many people but for me, still frustrating. After a long time of not knowing how to fix the problem, one day I stumbled upon some clues and I quickly tackled the problem to resolve my keyboard frustrations. Now my Right Alt and Left Alt keys work exactly the same when in console mode.

Please bear in mind that my solution is not for everybody and that my solution disables the standard AltGr function expected by many people.

  1. Look in /etc/rc.d to see if you have an rc.keymap script. If not, then you are using the Slackware default qwerty us.map keymap.
  2. If you have an rc.keymap script, then open the file to discover the keymap you are using.
  3. Now find your way to the /usr/share/kbd/keymaps/i386/qwerty directory.
  4. Find the keymap file you are using. All keymap files are compressed gzip files. If you are using the default keymap then the file name is us.map.gz.
  5. From the compressed gzip file, extract the keymap file to a temporary directory.
  6. Rename the extracted file to something such as us-two-alt.map.
  7. Open the renamed file with a text editor.
  8. In the first line of the file, modify the text to the exact name of the new file name.
  9. A couple of lines down look for the line that reads: include "linux-with-alt-and-altgr"
  10. Modify that line to read: include "linux-with-two-alt-keys"
  11. Save and exit the file.
  12. Create a new compressed gzip file and ensure you name the gzip file the same as you named the new keymap file. For example, us-two-alt.map.gz.
  13. Move the new gzip file to the /usr/share/kbd/keymaps/i386/qwerty directory.
  14. Standard file permissions for the file are chmod 644.
  15. If you do not have an rc.keymap file, then open a text editor to create one or simply copy the one included with this How-To and edit as necessary for your new keymap.

You now can run the rc.keymap script manually and both Alt keys should work the same. If later you decide that you want to restore the AltGr function associated with the Right Alt key, merely edit the rc.keymap script. Or, if you are handy with writing scripts, edit the rc.keymap file to toggle keymaps for you.

us-two-alt.map

/usr/share/kbd/keymaps/i386/qwerty/us-two-alt.map.gz

/etc/rc.d/rc.keymap

/etc/functions-colors

Finis.

Table of Contents