Wikia

Vim Tips Wiki

Changes: Swap caps-lock and control keys using MS Windows Registry

Edit

Back to page

(Creating an undo registry file)
(Replace merged tip with redirect)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
{{TipImported
+
#REDIRECT [[Map caps lock to escape in Windows]]
|id=353
 
|previous=352
 
|next=354
 
|created=October 29, 2002
 
|complexity=basic
 
|author=Jacques Petit
 
|version=5.7
 
|rating=73/27
 
|category1=
 
|category2=
 
}}
 
On Windows systems, you can edit the registry to change the code produced when a key is pressed. This tip shows how to change the keyboard layout so that the CapsLock key acts as a Ctrl key.
 
 
==Replacing CapsLock with Ctrl==
 
Place the following text into a text file with the extension *.reg and update your registry by double-clicking the file:
 
<pre>
 
REGEDIT4
 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
 
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
 
</pre>
 
 
You will probably need to reboot your machine for this system change to take effect.
 
 
====Undoing the change====
 
The verified way to reverse this setting is to delete the new scan codes key that was added.
 
 
(tested this on one of my machines)
 
 
====Swapping keys rather than replacing CapsLock====
 
The registry entry above sets CapsLock to Ctrl. The following registry entry swaps the CapsLock and Ctrl keys on your keyboard. Useful if you sometimes use CapsLock.
 
<pre>
 
REGEDIT4
 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
 
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00
 
</pre>
 
 
====Setting the key layout for the current user====
 
If the machine has multiple users who might not like the new layout, instead of using [HKEY_LOCAL_MACHINE\....] you can specify [HKEY_CURRENT_USER\Keyboard Layout]. This will make the changes for one user account only. Additionally, simply logging off and back on will apply the changes (no need to reboot).
 
 
==Comments==
 
Some explanation is [http://www.annoyances.org/exec/forum/winxp/t1004806455 here].
 
 
A more detailed explanation and reference can also be found [http://www.usnetizen.com/fix_capslock.php here].
 
----
 

Latest revision as of 11:51, July 19, 2009

  1. REDIRECT Map caps lock to escape in Windows

Around Wikia's network

Random Wiki