在 Windows 8 中,我曾经使用注册表脚本将 CapsLock 键重新映射到 Control 键
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
升级到 Windows 10 后,这个功能不再起作用。
如何做呢?
答案1
你记得重启了吗?对我来说,它运行良好,就像在 Windows 7 和 8 中一样。
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,1d,00,3a,00,00,00,00,00
答案2
如果有人需要通过以下方式完成此操作PowerShell
:
$hexified = "00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00".Split(',') | % { "0x$_"};
$kbLayout = 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout';
New-ItemProperty -Path $kbLayout -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$hexified);
以管理员身份运行它并重新启动。
答案3
答案4
我使用下面的命令将 CTRL 发送给 CAPS LOCK 键,将 ALT 发送给 CTRL 键,将 CAPS LOCK 发送给 ALT 键。CTRL 位于“A”的左侧,这是上帝所安排的,ALT 位于 SHIFT 下方,而完全没用的 CAPS LOCK 键则安全地藏在我必须扭断手腕才能按下的地方。
Windows Registry Editor Version 5.00
; The hex data is in five groups of four bytes:
; 00,00,00,00,\ header version (always 00000000)
; 00,00,00,00,\ header flags (always 00000000)
; 04,00,00,00,\ # of entries (3 in this case) plus a NULL terminator line.
; Entries are in 2-byte pairs: Key code to send & keyboard key to send it.
; Each entry is in "least significant byte, most significant byte" order,
; e.g. 0x1234 becomes `34,12`
; 1d,00,3a,00,\ Send LEFT CTRL (0x001d) code when user presses the CAPS LOCK key (0x003a)
; 38,00,1d,00,\ Send LEFT ALT (0x0038) code when user presses the LEFT CTRL key (0x001d)
; 3a,00,38,00,\ Send CAPS LOCK (0x003a) code when user presses the LEFT ALT key (0x0038)
; 00,00,00,00 NULL terminator
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,\
00,00,00,00,\
04,00,00,00,\
1d,00,3a,00,\
38,00,1d,00,\
3a,00,38,00,\
00,00,00,00