| Remapping XP, 2000, Vista and 2003 Keyboard Keys |
| By
: |
Vinod
|
| Date : |
24 - 04 - 2008 |
Desc :
Remap the Function Key, CapsLock Key or any Key in Windows XP, 2000, Vista and 2003
|
Remap the F12 Key, CapsLock Key or any Key in Windows XP, 2000, Vista and
2003
I often hit the Caps Lock key accidentally and find myself typing IN UPPER
CASE when I didn′t intend to. I then have to change the text to sentence case
like I wanted. I actually find no use at all for the Caps Lock key and changed
it′s behavior so it won′t stick in caps mode. In simply acts like a shift key
without the stickyness. This page details how to change this behavior as well as
changing any other key on the keyboard.
DOS and its Windows offspring, Win9x and ME, have a feature for keyboard
remapping. This was not included in Windows 2000 and XP. There is a way,
however, to remap keys in the registry. Backup your registry before starting.
This is advanced registry editing; if you are not comfortable editing the
registry, DO NOT ATTEMPT THIS. You can do it the easy way by downloading the .reg
file and merging into the registry, then rebooting.
Microsoft has a tool for creating keyboard layouts in Windows 2000, XP, and
2003. You can start from scratch or load an existing layout and modify it and
save it as a keyboard layout (.KLC) file . You can then select the keyboard
layout in Control Panel->Regional and Language Settings->Languages->Details. The
limitation of this tool is that you cannot change CapsLock, Tab, Shift, Ctrl,
Alt, Enter, Backspace, F1 to F12, Number pad, arrows, Ins, Del, PgUp, PgDn, etc.
Well... it's pretty limited. Try it yourself:
Experts only below this point!
Remap CapsLock Key
Open Regedit and go to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard
Layout]. Be careful not to edit the "Keyboard Layouts" key. If you want the
remapping to apply on a user-specific basis, log in as that user (you need to be
an administrator in XP
Home or have registry editing privileges, usually a power user or
administrator, in XP Pro) and use [HKEY_CURRENT_USER\Keyboard Layout].
Click on Edit->New->Binary Value and name it "Scancode Map" without the
quotes. The content of the key will depend on what behavior you want to assign
to the Caps Lock key. I simply set the Caps Lock key to function as the Left
Shift key. This way, I get caps while it′s down, no caps when it′s up. This has
no affect on the Left Shift key it continues to work normally.
In order to remap Caps Lock to Left Shift, double click the Scancode Map key
and enter the following binary values:
"00,00,00,00,00,00,00,00,02,00,00,00,2A,00,3A,00,00,00,00,00" without the quotes
or the commas and click OK.
Figure 1: Binary Value for Remapping Keyboard Keys
The important parts of this sequence are the 2a and the 3a. 2a is the target
of the remapping (Left Shift) and the 3a is the key that you will physically
push (Caps Lock). You can remap any key to function as any other key on your
keyboard by changing the binary values.
After entering the value, close Regedit and reboot. If you used the
HKEY_LOCAL_MACHINE key, the remapping should work immediately. If you used
HKEY_CURRENT_USER, it won′t take effect until after you have logged in.
Remap Multiple Keys
If you want to remap more than one key, such as swapping keys, you need to
add additional
codes to the same binary value. In the value for remapping the Caps Lock
key, the 02 reflects remapping of one key. 03 would be for two remaps, 04 for
three, etc.(one plus the number of remaps). Just change the 02 to reflect the
number of keys you are remapping.
Each remap is a series of four binary values. For the Caps Lock example, the
values are 2a, 00, 3a, 00. A remap of the Left Alt key to function as Backspace,
would be 0e, 00, 38, 00. To combine these two remaps, change the 02 to 03 and
add the four values after the 2a, 00, 3a, 00 resulting in a longer binary value
for the key. The remapping of two keys - Caps Lock to Left Shift and Left Alt to
Backspace would look like
"00,00,00,00,00,00,00,00,03,00,00,00,2A,00,3A,00,0E,00,38,00,00,00,00,00". The
sequence needs to start with eight pairs of zeroes and end in four pairs of
zeroes. Since the Caps Lock feature is no longer available after using these
methods, you could remap a fairly useless key like Scroll Lock to function as
Caps Lock (3a,00,46,00).
Remap Any Key
Aside from altering the Caps Lock key, remapping multiple keys could be very
useful for Point-of-Sale systems or games that make heavy use of keyboard
shortcuts. If the remapping is applied on a per user basis, a normal keyboard
layout could be regained by logging in as another user.
Table 1: Examples
| Physical Key |
New Function |
Binary Value |
| CapsLock |
Left Shift |
00,00,00,00,00,00,00,00,02,00,00,00,2a,00,3a,00,00,00,00,00 |
CapsLock
ScrollLock |
Left Shift
CapsLock |
00,00,00,00,00,00,00,00,03,00,00,00,2a,00,3a,00,3a,00,46,00,
00,00,00,00 |
Left Ctrl
CapsLock |
CapsLock
Left Ctrl |
00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,
00,00,00,00 |
| PrntScn |
Right Windows |
00,00,00,00,00,00,00,00,02,00,00,00,5c,e0,37,e0,00,00,00,00 |
You can use these examples directly by creating a new text file and naming it
"remap.reg" or anything with the .reg extension. Then paste in the following
text:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard
Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,5c,e0,37,e0,00,00,00,00
Be sure to include a blank line at the end (an extra carriage return). You
can substitute an example from the table for the text after the hex:. You can
also use it as a boilerplate for creating your own remap sequence.
Save the file and right-click and choose Merge. This will place it into your
registry and will take affect on the next boot.
Below are fairly complete scan codes for common keyboards. There are a
number of codes not implemented and may represent nonstandard keys that launch
applications.
To simply disable a key, its target should be 00 00. Those listed below as
No
Code cannot be remapped. I have not tested for a limit on the number of
remaps possible using this technique. I suspect that the limit is 255
characters in the binary value. If you need to change a lot of keys, start with
the Microsoft Keyboard Layout Creator to change the standard QWERTY keys first.
Table 2: Complete Scan Codes
| Special Keys |
Scan Code |
| Application |
5D E0 |
| Backspace |
0E 00 |
| Caps Lock |
3A 00 |
| Delete |
53 E0 |
| End |
4F E0 |
| Enter |
1C 00 |
| Escape |
01 00 |
| HOME |
47 E0 |
| Insert |
52 E0 |
| Left Alt |
38 00 |
| Left Ctrl |
1D 00 |
| Left Shift |
2A 00 |
| Left Windows |
5B E0 |
| Num Lock |
45 00 |
| Page Down |
51 E0 |
| Page Up |
49 E0 |
| Power |
5E E0 |
| PrtSc |
37 E0 |
| Right Alt |
38 E0 |
| Right Ctrl |
1D E0 |
| Right Shift |
36 00 |
| Right Windows |
5C E0 |
| Scroll Lock |
46 00 |
| Sleep |
5F E0 |
| Space |
39 00 |
| Tab |
0F 00 |
| Wake |
63 E0 |
|
| Number Pad Keys |
Scan Code |
| 0 |
52 00 |
| 1 |
4F 00 |
| 2 |
50 00 |
| 3 |
51 00 |
| 4 |
4B 00 |
| 5 |
4C 00 |
| 6 |
4D 00 |
| 7 |
47 00 |
| 8 |
48 00 |
| 9 |
49 00 |
| - |
4A 00 |
| * |
37 00 |
| . |
53 00 |
| / |
35 E0 |
| + |
4E 00 |
| Enter |
1C E0 |
| Arrow Keys |
Scan Code |
| Down |
50 E0 |
| Left |
4B E0 |
| Right |
4D E0 |
| Up |
48 E0 |
|
| Function Keys |
Scan Code |
| F1 |
3B 00 |
| F2 |
3C 00 |
| F3 |
3D 00 |
| F4 |
3E 00 |
| F5 |
3F 00 |
| F6 |
40 00 |
| F7 |
41 00 |
| F8 |
42 00 |
| F9 |
43 00 |
| F10 |
44 00 |
| F11 |
57 00 |
| F12 |
58 00 |
| F13 |
64 00 |
| F14 |
65 00 |
| F15 |
66 00 |
| Application Keys |
Scan Code |
| Calculator |
21 E0 |
| E-Mail |
6C E0 |
| Media Select |
6D E0 |
| Messenger |
11 E0 |
| My Computer |
6B E0 |
|
| QWERTY Keys |
Scan Code |
| ' " |
28 00 |
| - _ |
0C 00 |
| , < |
33 00 |
| . > |
34 00 |
| /? |
35 00 |
| ;: |
27 00 |
| [ { |
1A 00 |
| \ | |
2B 00 |
| ] } |
1B 00 |
| ` ~ |
29 00 |
| = + |
0D 00 |
| 0 ) |
0B 00 |
| 1 ! |
02 00 |
| 2 @ |
03 00 |
| 3 # |
04 00 |
| 4 $ |
05 00 |
| 5% |
06 00 |
| 6 ^ |
07 00 |
| 7 & |
08 00 |
| 8 * |
09 00 |
| 9 ( |
0A 00 |
| A |
1E 00 |
| B |
30 00 |
| C |
2E 00 |
| D |
20 00 |
| E |
12 00 |
| F |
21 00 |
| G |
22 00 |
| H |
23 00 |
| I |
17 00 |
| J |
24 00 |
| K |
25 00 |
| L |
26 00 |
| M |
32 00 |
| N |
31 00 |
| O |
18 00 |
| P |
19 00 |
| Q |
10 00 |
| R |
13 00 |
| S |
1F 00 |
| T |
14 00 |
| U |
16 00 |
| V |
2F 00 |
| W |
11 00 |
| X |
2D 00 |
| Y |
15 00 |
| Z |
2C 00 |
|
| F-Lock Keys |
Scan Code |
| Close |
40 E0 |
| Fwd |
42 E0 |
| Help |
3B E0 |
| New |
3E E0 |
| Office Home |
3C E0 |
| Open |
3F E0 |
| Print |
58 E0 |
| Redo |
07 E0 |
| Reply |
41 E0 |
| Save |
57 E0 |
| Send |
43 E0 |
| Spell |
23 E0 |
| Task Pane |
3D E0 |
| Undo |
08 E0 |
| Media Keys |
Scan Code |
| Mute |
20 E0 |
| Next Track |
19 E0 |
| Play/Pause |
22 E0 |
| Prev Track |
10 E0 |
| Stop |
24 E0 |
| Volume Down |
2E E0 |
| Volume Up |
30 E0 |
| Web Keys |
Scan Code |
| Back |
6A E0 |
| Favorites |
66 E0 |
| Forward |
69 E0 |
| HOME |
32 E0 |
| Refresh |
67 E0 |
| Search |
65 E0 |
| Stop |
68 E0 |
| Disable |
Turn Key Off |
00 00 |
|
| Manufacturer |
Special Keys |
Scan Code |
| Dell |
Internet |
01 E0 |
| Dell |
Fn |
No Code |
| Dell |
Decrease Brightness |
40 05 E0 |
| Dell |
Increase Brightness |
40 06 E0 |
| Dell |
CRT/LCD |
No Code |
| Logitech |
iTouch |
13 E0 |
| Logitech |
Shopping |
04 E0 |
| Logitech |
Webcam |
12 E0 |
| Non-English (US) Keys |
Scan Code |
| ¥ - |
7D 00 |
| € |
45 E0 |
| International Keyboard |
| Next to Enter |
2B E0 |
| Next to L-Shift |
56 E0 |
| Brazilian Keyboard |
| Next to R-Shift |
73 E0 |
| Far East Keyboard |
| DBE_KATAKANA |
70 E0 |
| DBE_SBCSCHAR |
77 E0 |
| CONVERT |
79 E0 |
| NONCONVERT |
7B E0 |
| Microsoft Natural Multimedia Keyboard |
Scan Code |
| My Documents |
|
| My Pictures |
64 E0 |
| My Music |
3C E0 |
| Mute |
20 E0 |
| Play/Pause |
22 E0 |
| Stop |
24 E0 |
| + (Volume up) |
30 E0 |
| - (Volume down) |
2E E0 |
| |<< (Previous) |
10 E0 |
| >>| (Next) |
19 E0 |
| Media |
6D E0 |
| Mail |
6C E0 |
| Web/Home |
32 E0 |
| Messenger |
05 E0 |
| Calculator |
21 E0 |
| Log Off |
16 E0 |
| Sleep |
5F E0 |
| Help (on F1 key) |
3B E0 |
| Undo (on F2 key) |
08 E0 |
| Redo (on F3 key) |
07 E0 |
| New (on F4 key) |
|
| Open (on F5 key) |
|
| Close (on F6 key) |
|
| Replay (on F7 key) |
|
| Fwd (on F8 key) |
42 E0 |
| Send (on F9 key) |
43 E0 |
| Spell (on F10 key) |
23 E0 |
| Save (on F11 key) |
57 E0 |
| Print (on F12 key) |
58 E0 |
|
|
BACK
|
|