dotfiles/windows/autohotkey/RemapCapsCtrlEscapeV2.ahk

24 lines
341 B
AutoHotkey
Raw Normal View History

2024-06-02 12:08:05 +00:00
#Requires AutoHotkey v2.0
#SingleInstance
ih := InputHook("B L1 T1", "{Esc}")
*Ctrl::
{
ih.Start()
reason := ih.Wait()
if (reason = "Stopped") {
Send "{Esc}"
} else if (reason = "Max") {
Send "{Blind}{Ctrl down}" ih.Input
}
}
*Ctrl up::
{
if (ih.InProgress) {
ih.Stop()
} else {
Send "{Ctrl up}"
}
}