http://www.blog.edu.cn/user1/2746/archives/2004/5151.shtml
摘要:
修改注册表,定义键位映射,不仅可以交换某几个键位的位置,还可以增强键盘的功能,比如把右alt键、右win键等设置为调整音量大小等。
实在受不了在latex中反复的按\键,右手的负担太重了,所以我就把capslock键换成了\,又把右侧的win键换成了capslock。方法是定义scancode的mapping,重定义这两个键的scancode。
正文:
打开注册表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout,新建Scancode Map键,类型为二进制值。在输入键值之前,先在纸上把整个数据按次序写一下:
00000000 header version (zero) 必须为0
00000000 header flags (zero) 必须为0
00000003 number of entries (including terminator) 映射个数加1
003A002B map CAPSLOCK (0x3A) to \ 一个映射
E05C003A RWin to capslock 另一个映射
00000000 null terminator map 必须为0
每个映射中,前半部分是原先按键的scancode,后半是要改成的scancode。所有按键的scancode在最后的表中列出。
注意不能直接输入上面的值。注册表中,二进制值要把每个字节高低位重新排一下,如:
00000000 00000000 03000000 2B003A00 3A005CE0 00000000
再输入。输入之后看起来是这样:
最后重启机器就可以了
可以定义别的映射,比如把右alt(E038)设为静音(E020)等。要注意修改第3个字节中的映射个数值。
最后,我还想把[]和{}互换,但这不能用这种方法来做,估计必须修改kbdus.dll,定义自己的语言才行。还没找到怎么改kbdus.dll的方法……
Update:
终于找到了修改键位的软件!KEYBOARD LAYOUT MANAGER,主页是
http://www.klm.freeservers.com
我下的是medium版,现在可以修改[]和{}了:)
这是共享软件,但它的原理不过是是生成新的kbdus.dll而已,我想只要把\windows\system32\kbdus.dll拷出来做个备份就可以了吧。
附:scancode表(注意我们只需用到MAKE code)
MAKE code - code generated when key is pressed.
BREAK code - code generated when key is released.
Keyboard Scan Codes Set 1
|
KEY Name |
Define Value (decimal) |
Label |
Additional Label |
MAKE (hex) |
BREAK (hex)
|
Escape |
1 |
Esc |
|
0x01 |
0x81
|
1 |
2 |
1 |
! |
0x02 |
0x82
|
2 |
3 |
2 |
@ |
0x03 |
0x83
|
3 |
4 |
3 |
# |
0x04 |
0x84
|
4 |
5 |
4 |
$ |
0x05 |
0x85
|
5 |
6 |
5 |
% |
0x06 |
0x86
|
6 |
7 |
6 |
^ |
0x07 |
0x87
|
7 |
8 |
7 |
& |
0x08 |
0x88
|
8 |
9 |
8 |
* |
0x09 |
0x89
|
9 |
10 |
9 |
( |
0x0A |
0x8A
|
0 |
11 |
0 |
) |
0x0B |
0x8B
|
Minus |
12 |
- |
_ |
0x0C |
0x8C
|
Equal |
13 |
= |
+ |
0x0D |
0x8D
|
BackSpace |
14 |
BackSpace |
|
0x0E |
0x8E
|
Tab |
15 |
Tab |
|
0x0F |
0x8F
|
Q |
16 |
Q |
|
0x10 |
0x90
|
W |
17 |
W |
|
0x11 |
0x91
|
E |
18 |
E |
|
0x12 |
0x92
|
R |
19 |
R |
|
0x13 |
0x93
|
T |
20 |
T |
|
0x14 |
0x94
|
Y |
21 |
Y |
|
0x15 |
0x95
|
U |
22 |
U |
|
0x16 |
0x96
|
I |
23 |
I |
|
0x17 |
0x97
|
O |
24 |
O |
|
0x18 |
0x98
|
P |
25 |
P |
|
0x19 |
0x99
|
LBrace |
26 |
[ |
{ |
0x1A |
0x9A
|
RBrace |
27 |
] |
} |
0x1B |
0x9B
|
Enter |
28 |
Enter |
|
0x1C |
0x9C
|
LCtrl |
29 |
Ctrl (left) |
|
0x1D |
0x9D
|
A |
30 |
A |
|
0x1E |
0x9E
|
S |
31 |
S |
|
0x1F |
0x9F
|
D |
32 |
D |
|
0x20 |
0xA0
|
F |
33 |
F |
|
0x21 |
0xA1
|
G |
34 |
G |
|
0x22 |
0xA2
|
H |
35 |
H |
|
0x23 |
0xA3
|
J |
36 |
J |
|
0x24 |
0xA4
|
K |
37 |
K |
|
0x25 |
0xA5
|
L |
38 |
L |
|
0x26 |
0xA6
|
SemiColon |
39 |
; |
: |
0x27 |
0xA7
|
Quote |
40 |
' |
" |
0x28 |
0xA8
|
Tilde |
41 |
` |
~ |
0x29 |
0xA9
|
LShift |
42 |
Shift (left) |
|
0x2A |
0xAA
|
BackSlash |
43 |
\ |
| |
0x2B |
0xAB
|
Z |
44 |
Z |
|
0x2C |
0xAC
|
X |
45 |
X |
|
0x2D |
0xAD
|
C |
46 |
C |
|
0x2E |
0xAE
|
V |
47 |
V |
|
0x2F |
0xAF
|
B |
48 |
B |
|
0x30 |
0xB0
|
N |
49 |
N |
|
0x31 |
0xB1
|
M |
50 |
M |
|
0x32 |
0xB2
|
Comma |
51 |
, |
< |
0x33 |
0xB3
|
Period |
52 |
. |
> |
0x34 |
0xB4
|
Slash |
53 |
/ |
? |
0x35 |
0xB5
|
RShift |
54 |
Shift (right) |
|
0x36 |
0xB6
|
KP_Multiply |
55 |
* |
|
0x37 |
0xB7
|
LAlt |
56 |
Alt (left) |
|
0x38 |
0xB8
|
Space |
57 |
SpaceBar |
|
0x39 |
0xB9
|
CapsLock |
58 |
CapsLock |
|
0x3A |
0xBA
|
F1 |
59 |
F1 |
|
0x3B |
0xBB
|
F2 |
60 |
F2 |
|
0x3C |
0xBC
|
F3 |
61 |
F3 |
|
0x3D |
0xBD
|
F4 |
62 |
F4 |
|
0x3E |
0xBE
|
F5 |
63 |
F5 |
|
0x3F |
0xBF
|
F6 |
64 |
F6 |
|
0x40 |
0xC0
|
F7 |
65 |
F7 |
|
0x41 |
0xC1
|
F8 |
66 |
F8 |
|
0x42 |
0xC2
|
F9 |
67 |
F9 |
|
0x43 |
0xC3
|
F10 |
68 |
F10 |
|
0x44 |
0xC4
|
NumLock |
69 |
NumLock |
|
0x45 |
0xC5
|
ScrollLock |
70 |
Scroll Lock |
|
0x46 |
0xC6
|
KP_7 |
71 |
7 |
Home |
0x47 |
0xC7
|
KP_8 |
72 |
8 |
ArrowU |
0x48 |
0xC8
|
KP_9 |
73 |
9 |
PgUp |
0x49 |
0xC9
|
KP_Minus |
74 |
- |
|
0x4A |
0xCA
|
KP_4 |
75 |
4 |
ArrowL |
0x4B |
0xCB
|
KP_5 |
76 |
5 |
|
0x4C |
0xCC
|
KP_6 |
77 |
6 |
ArrowR |
0x4D |
0xCD
|
KP_Plus |
78 |
+ |
|
0x4E |
0xCE
|
KP_1 |
79 |
1 |
End |
0x4F |
0xCF
|
KP_2 |
80 |
2 |
ArrowD |
0x50 |
0xD0
|
KP_3 |
81 |
3 |
PgDn |
0x51 |
0xD1
|
KP_0 |
82 |
0 |
Ins |
0x52 |
0xD2
|
KP_Decimal |
83 |
. |
Del |
0x53 |
0xD3
|
F11 |
84 |
F11 |
|
0x57 |
0xD7
|
F12 |
85 |
F12 |
|
0x58 |
0xD8
|
PrintScreen |
86 |
Print Screen |
SysRq |
0xE0 0x2A 0xE0 0x37 |
0xE0 0xB7 0xE0 0xAA
|
Pause |
87 |
Pause |
Break |
0xE1 0x1D 0x45 0xE1 0x9D 0xC5 |
-NONE-
|
KP_Enter |
88 |
Enter |
|
0xE0 0x1C |
0xE0 0x9C
|
RCtrl |
89 |
Ctrl (right) |
|
0xE0 0x1D |
0xE0 0x9D
|
KP_Slash |
90 |
/ |
|
0xE0 0x35 |
0xE0 0xB5
|
RAlt |
91 |
Alt (right) |
|
0xE0 0x38 |
0xE0 0xB8
|
Home |
92 |
Home |
|
0xE0 0x47 |
0xE0 0xC7
|
ArrowU |
93 |
ArrowU |
|
0xE0 0x48 |
0xE0 0xC8
|
PageUp |
94 |
Page Up |
|
0xE0 0x49 |
0xE0 0xC9
|
ArrowL |
95 |
ArrowL |
|
0xE0 0x4B |
0xE0 0xCB
|
ArrowR |
96 |
ArrowR |
|
0xE0 0x4D |
0xE0 0xCD
|
End |
97 |
End |
|
0xE0 0x4F |
0xE0 0xCF
|
ArrowD |
98 |
ArrowD |
|
0xE0 0x50 |
0xE0 0xD0
|
PageDown |
99 |
Page Down |
|
0xE0 0x51 |
0xE0 0xD1
|
Insert |
100 |
Insert |
|
0xE0 0x52 |
0xE0 0xD2
|
Delete |
101 |
Delete |
|
0xE0 0x53 |
0xE0 0xD3
|
LWin |
102 |
LWin |
|
0xE0 0x5B |
0xE0 0xDB
|
RWin |
103 |
RWin |
|
0xE0 0x5C |
0xE0 0xDC
|
Menu |
104 |
Menu |
|
0xE0 0x5D |
0xE0 0xDD
|
Power |
105 |
Power |
|
0xE0 0x5E |
0xE0 0xDE
|
Sleep |
106 |
Sleep |
|
0xE0 0x5F |
0xE0 0xDF
|
Wake |
107 |
Wake |
|
0xE0 0x63 |
0xE0 0xE3
|
NextTrack |
108 |
Next Track |
|
0xE0 0x19 |
0xE0 0x99
|
PreviousTrack |
109 |
Previous Track |
|
0xE0 0x10 |
0xE0 0x90
|
Stop |
110 |
Stop |
|
0xE0 0x24 |
0xE0 0xA4
|
Play_Pause |
111 |
Play_Pause |
|
0xE0 0x22 |
0xE0 0xA2
|
Mute |
112 |
Mute |
|
0xE0 0x20 |
0xE0 0xA0
|
VolumeUp |
113 |
Volume Up |
|
0xE0 0x30 |
0xE0 0xB0
|
VolumeDown |
114 |
Volume Down |
|
0xE0 0x2E |
0xE0 0xAE
|
MediaSelect |
115 |
Media |
|
0xE0 0x6D |
0xE0 0xED
|
EMail |
116 |
E-Mail |
|
0xE0 0x6C |
0xE0 0xEC
|
Calculator |
117 |
Calculator |
|
0xE0 0x21 |
0xE0 0xA1
|
MyComputer |
118 |
My Computer |
|
0xE0 0x6B |
0xE0 0xEB
|
WWWSearch |
119 |
WWW Search |
|
0xE0 0x65 |
0xE0 0xE5
|
WWWHome |
120 |
WWW Home |
|
0xE0 0x32 |
0xE0 0xB2
|
WWWBack |
121 |
WWW Back |
|
0xE0 0x6A |
0xE0 0xEA
|
WWWForward |
122 |
WWW Forward |
|
0xE0 0x69 |
0xE0 0xE9
|
WWWStop |
123 |
WWW Stop |
|
0xE0 0x68 |
0xE0 0xE8
|
WWWRefresh |
124 |
WWW Refrash |
|
0xE0 0x67 |
0xE0 0xE7
|
WWWFavorites |
125 |
WWW Favorites |
|
0xE0 0x66 |
0xE0 0xE6
|