windows
运行regedit.exe
打开
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout\ 下新建一个二进制值项: “Scancode Map”
双击编辑,添加键盘映射
字节数 0 1 2 3 4 5 6 7
0000 00 00 00 00 00 00 00 00 # 首行固定,全0
0008 01 00 00 00 1D 00 3A 00 # 01 00 00 00 表示修改一个按键
# 1D 00 表示 目标 左Ctrl
# 3A 00 表示 源 Cap Lock
# 按键个数 1<<1 一个
# 1 << 2 2个
# 1 << 3 3个
另一个例子
0000 00 00 00 00 00 00 00 00
0008 04 00 00 00 1D 00 5B E0 # 04 00 00 00 表示修改3个按键
0010 1D E0 5C E0 5B E0 1D 00
0018 00 00 00 00
键盘符号表
按键 码表
Escape 01 00
Tab 0F 00
Caps Lock 3A 00
Left Alt 38 00
Left Ctrl 1D 00
Left Shift 2A 00
Left Windows 5B E0
Right Alt 38 E0
Right Ctrl 1D E0
Right Shift 36 00
Right Windows 5C E0
Backspace 0E 00
Delete 53 E0
Enter 1C 00
Space 39 00
Insert 52 E0
HOME 47 E0
End 4F E0
Num Lock 45 00
Page Down 51 E0
Page Up 49 E0
Scroll Lock 46 00
无动作 00 00