__Quick and Dirty Linux Keymapping HOWTO__ Todd Warner Last updated: 2002-11-21 ------------------------------------------------------------------------------- NOTE: The keymap info here has been only tested with Red Hat Linux v7.* and 8.*. There is no reason I can think of that all this doesn't apply to most linux systems. ------------------------------------------------------------------------------- I wanted to change my keyboard layout on my Red Hat Linux 7.*/8.* boxes that use a standard 101+ key keyboard (US locale!). Key swap table (the mappings I changed): escape <--> ~` (tilde/grave) control (left) <--> Caps Lock ------------------------------------------------------------------------------- *** HOWTO: do all steps as root: STEP #1: Download the correct key-map file and copy into the /lib/kbd/keymaps/i386/qwerty/ directory. For Red Hat Linux 7.*: http://www.pobox.com/~taw/us_taw-RHL7.kmap.gz For Red Hat Linux 8.*: http://www.pobox.com/~taw/us_taw-RHL8.map.gz Also, if Red Hat Linux 8.*: Download http://www.pobox.com/~taw/xmodmap.us_intl-taw-RHL8 and copy it to directory /usr/share/xmodmap/ STEP #2: NOTE: it's easiest to do these steps in a console, not in X. So if you are in X, do an Ctrl-Alt-F1 and get to a console. 1. edit file /etc/sysconfig/keyoard. Change it to read: KEYTABLE="us_taw-RHL8" ...or whichever version applies to your system. 2. Set up X to use the settings as well: Red Hat Linux 7.*: Change/uncomment a line in /etc/X11/XF86Config-4. Change the line that includes "XkbDisable" to read something like: Option "XkbDisable" That turns off XKEYBOARD extensions... which I know nothing about currently. This forces X to use the console settings. Red Hat Linux 8.*: Change the appropriate "InputDevice" in /etc/X11/XF86Config to read something like... Section "InputDevice" Identifier "Keyboard0" Driver "keyboard" Option "XkbRules" "xfree86" Option "XkbModel" "pc104" Option "XkbLayout" "us_intl-taw-RHL8" Option "XkbOptions" "ctrl:swapcaps" EndSection NOTE: I just learned about the xmodmap stuff; you may be able to configure Red Hat Linux 7.* boxes simularly to v8.* boxes. I just haven't tried it. STEP #3: Test the console: service keytable restart If all goes well, your console should be operating with the new settings, if not, a... loadkeys /lib/kbd/keymaps/i386/qwerty/us.kmap.gz or for Red Hat Linux v8.* loadkeys /lib/kbd/keymaps/i386/qwerty/us.map.gz Will bring things back to normal. STEP #4: Restart X: init 3 init 5 ------------------------------------------------------------------------------- USEFUL INFO: In order to see currently loaded keymappings (console): dumpkeys To load a new keymap (console): loadkeys ...keymap file... To see how a particular key is addressed (console): showkey To see how a particular key is addressed (X --- which is different if XkbDisable is not set in XF86Config-4): xev -------------------------------------------------------------------------------