如何将 Autohotkey 中的 CapsLock 映射到 Esc 和 Ctrl?

问题描述 投票:0回答:1

如何重新映射 Capslock 键,使按下并释放它注册为 Escape 键,但按住它注册为 Ctrl 键修饰符?

我正在寻找一个最好使用 Autohotkey v2 的 Windows 解决方案。

windows keyboard-shortcuts autohotkey key-bindings
1个回答
0
投票
#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}"
}
© www.soinside.com 2019 - 2024. All rights reserved.