Dies ist eine alte Version des Dokuments!
in /etc/Xtt/xorg.conf einfügen:
Section "InputDevice" . . . Option "XkbOptions" "caps:shiftlock"
Quelle1)
If you have loadkeys (as you would under Linux), this should do the trick:
loadkeys /usr/share/keymaps/i386/qwerty/emacs2.kmap.gz
To reset to the defaults (you may have to switch to another tty and back to undo ctrl-lock):
loadkeys -d
Under Redhat 8.0, just enable the following line in /etc/X11/XF86Config
Option "XkbOptions" "ctrl:swapcaps"
Replace „swapcaps“ with „nocaps“ to turn both keys into „Control.“
With X, there are at least 2 different ways to remap the keys. One is using xmodmap. For example, man xmodmap shows how to swap the left control key and the CapsLock key:
! ! Swap Caps_Lock and Control_L ! remove Lock = Caps_Lock remove Control = Control_L keysym Control_L = Caps_Lock keysym Caps_Lock = Control_L add Lock = Caps_Lock add Control = Control_L
Many people don't want a CapsLock key at all. They can change the CapsLock key to a ControlKey? by using the following lines in xmodmap:
clear Lock keycode 0x7e = Control_R add Control = Control_R
Maybe you have to change the keycode 0x7e. You can find the keycodes with xev. I Furthermore, this only works if you don't have a right control key. I hope somebody has a solution which does not have this restriction.
This solution might be the easiest one. If you do not have a problem owning a dead key in your keyboard you might disable CapsLock at all:
"remove lock = Caps_Lock" (or just: "clear lock")
A better solution might be this sequence, which is keycode independent and does not remove existing control keys:
remove Lock = Caps_Lock remove Control = Control_L keysym Caps_Lock = Control_L add Lock = Caps_Lock add Control = Control_L
Now, you can use another solution which uses xkb. For that, you will have to find the sybols directory on your unix system. There, you add a file which might be called 'ctrl' containing the following:
// eliminate the caps lock key completely (replace with control) partial modifier_keys xkb_symbols "nocaps" { key <CAPS> { symbols[Group1]= [ Control_L ] }; modifier_map Control { <CAPS>, <LCTL> }; };
This eliminates the caps lock key if included in a keymap. We can do this by changing the file en_US:
xkb_symbols "pc101" { include "ctrl(nocaps)" key <RALT> { [ Mode_switch, Multi_key ] }; augment "us(pc101)" include "iso9995-3(basic101)" modifier_map Mod3 { Mode_switch }; };
You can then add the keyboard using a line like:
/usr/X11R6/lib/X11/xkb/xkbcomp -w 1 -R/usr/X11R6/lib/X11/xkb -xkm -m en_US keymap/xfree86 0:0
Now, unfortunately there are probably errors in the text above. Please correct and make it working for other systems than RedHat Linux.
From WhyNotUseEmacs:
Add the following to your Xmodmap (on many linuxes the default Xmodmap is located at /etc/X11/Xmodmap):
clear lock add control = Caps_Lock
You can activate this in a already-running X using
xmodmap /etc/X11/Xmodmap # or whatever the name of your modmap file is.
This will turn your caps lock into a control key. You won't have a caps lock key anymore, so make sure caps lock is off when you do this. ;) – KevinStone? If you get stuck and find yourself without a control key use xev to find the keycode of your control and caps lock keys. Then use the following to restore the default config.
remove Lock = Caps_Lock remove Control = Control_L keycode <keycodeofcontrol> = Control_L keycode <keycodeofcapslock> = Caps_Lock add Lock = Caps_Lock add Control = Control_L
It is also possible to make the Caps_Lock a handy additional shourcut modifier, ie.:
remove Lock = Caps_Lock keysym Caps_Lock = Meta_L