[PLUG] loadkeys: remapping ctrl_l and caps_lock

Dean S. Messing deanm at sharplabs.com
Fri Jul 12 19:01:12 UTC 2002


Rich Shepard wrote:
 ::   I've read the men pages for loadkeys, dumpkeys and keymaps. According to
 :: the keymaps man page, the following will swap the left control key and the
 :: caps lock key when working on a console:
 :: 
 :: # Exchange the left Control key and the Caps Lock key on the keyboard
 :: keycode 58 = Control
 :: keycode 29 = Caps_Lock
 :: 
 ::   This did not work when I tried it out. Then I ran dumpkeys and learned
 :: that that's how the keys are already defined. So, I'm missing something
 :: here and I'd appreciate some guidance on how to effect this change.

I answered too quickly.  Try my suggestion anyway, but be sure
to reboot or, in some way, make sure you are starting out with
the right initial condx.  If you had run loadkeys and then run dumpkeys
I would expect to see what  you saw in your third paragraph.

Sorry, don't know too much about keyboard stuff.  However:

 ::   I've swapped the two keys in X on both my workstation and notebook by
 :: creating a ~/.xmodmap from the examples in the man page. Works just fine.
 :: Now I want to do the same thing, especially on the notebook. On that machine
 :: I constantly press the caps lock key when reaching for the tab key. By
 :: swapping the control and caps lock keys I'll both eliminate that problem and
 :: put the control key where it's more easily reached while typing.

putting:

# If you'd like to switch the positions of your capslock and
# control keys, use:
    XkbOptions  "ctrl:swapcaps"

in your /etc/X11/XF86Config file if you run X 3.3.x

(or if you run X 4.x.x use

    Option "XkbOptions" "ctrl:swapcaps"

in your /etc/X11/XF86Config-4 file)

will obviate (love dem $5 words) the need for the .xmodmap hokus-pokus.


Dean




More information about the PLUG mailing list