如何重新映射 Capslock 键,使按下并释放它注册为 Escape 键,但按住它注册为 Ctrl 键修饰符?
我正在寻找一个最好使用 Autohotkey v2 的 Windows 解决方案。
#Requires AutoHotkey v2.0
; Force Capslock to stay off permanently:
SetCapsLockState "AlwaysOff"
Capslock::Send "{Ctrl down}"
; The *-prefix fires the hotkey even if extra modifiers (Ctrl in this case) are being held down:
*Capslock Up::{
Send "{Ctrl Up}"
If (A_PriorKey = "Capslock") ; If Capslock was pressed alone
Send "{Esc}"
}