Pages

Saturday, July 21, 2007

Switch Caps Lock to Ctrl

On Windows XP Professional
It's actually not switch but swap Caps Lock key with Control key on a Windows XP professional version.

1. start -> Run -> regedit
2. Find the Keyboard Layout directory where is in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
3. Click on Edit->New->Binary Value
4. Name it "Scancode Map" without the quotes
5. Right click -> Modify
6. Input the values below
00,00,00,00,00,00,00,00,
03,00,00,00,1d,00,3a,00,
3a,00,1d,00,00,00,00,00

Reference: http://www.usnetizen.com/fix_capslock.html

On Ubuntu 7.04 Feisty
1. create .Xmodmap file in your home directory
$ vi ~/.Xmodmap
2. write down below
! Switch caps lock and left control
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
3. load .Xmodmap file
$ xmodmap ~/.Xmodmap
4. next time you log in to your Gnome, it will detect .Xmodmap file automatically. Thus, next steps are not really necessary.

If ~/.xinitrc doesn't exist
$ cp /etc/X11/xinit/xinitrc ~/.xinitrc
In all cases
$ vi ~/.xinitrc
in the first line,
xmodmap ~/.Xmodmap

References:
http://ubuntuguide.org/wiki/Ubuntu:Feisty#How_to_remap_the_Caps_Lock_key_as_another_Control_key
http://dinomite.net/archives/caps-lock-to-control-on-ubuntu

No comments: