Red Hat Linux 9 now uses yet another method to control the keyboard and mapping of keys. (actually, the older xmodmap method still works.) In order to swap the "Caps Lock" and ctrl keys, I now need to do: setxkbmap -layout us -model pc105 -option "" \ -symbols "pc/pc(pc105)+pc/us+ctrl(swapcaps)" ------------- To tailor for your situation, first run "redhat-config-keyboard" from an X-windows terminal. This will pop open their keyboard utility, and send a message to your terminal telling you what commands it will execute. In my case, selecting the "U.S. English" keyboard generates the following information: $ redhat-config-keyboard Loading //lib/kbd/keymaps/i386/qwerty/us.map.gz * running ['/usr/X11R6/bin/setxkbmap', '-layout', 'us', '-model', 'pc105', '-option', ''] The equivalent way to do this from the command line is: setxkbmap -layout us -model pc105 -option "" \ -symbols "pc/pc(pc105)+pc/us" We append "+ctrl(swapcaps)" to the list of symbols to do what we want. Possible symbol choices are listed in /usr/X11R6/lib/X11/xbk/symbols. For example, "pc/pc(pc105)" refers to the pc105 section of file pc in directory subdirectory pc of xkb/symbols. Symbols options are separated by "+". (Source code for redhat-config-keyboard is in /usr/share/redhat-config-keyboard/.) ----------- Put this in a shell script ~/bin/swap-caps.sh, and automatically startup by putting "swap-caps.sh" (without ~/bin) in Start Here, Preferences, More Preferences, Sessions, Startup Programs. More info: /usr/X11R6/lib/X11/xkb ----------- ----------- ----------- To set the keymap used in VGA mode (simple text screen, not in X-windows): dumpkeys > us.map cp us.map us-swapcaps.map Make the following modifications: $ diff us.map us-swapcaps.map 0a1,6 > # us_greg.map > # Modified version of US keyboard, to swap "Caps Lock" and left "Ctrl" keys. > # Greg Hammett > # > # left Backspace and delete alone (which are okay in text/VGA virtual ttys). > # 36c42 < keycode 29 = Control --- > keycode 29 = Caps_Lock # this key is labelled "Ctrl" in lower left 70c76 < keycode 58 = Caps_Lock --- > keycode 58 = Control # this key is labelled "Caps Lock" on left $ gzip us-swapcaps.map cp -p us-swapcaps.map.gz /lib/kbd/keymaps/i386/qwerty # cp -p us-swapcaps.map.gz /usr/lib/kbd/keymaps/i386/qwerty # in Linux 7.0 # cp -p us-swapcaps.map.gz /usr/lib/kbd/keytables # on older Linux, put here # /usr/sbin/kbdconfig # and select us-swapcaps But kbdconfig doesn't exist anymore! So have to edit /etc/sysconfig/keyboard by hand, and replace KEYTABLE="us" with KEYTABLE="us-swapcaps"