From 7a22e798fc019049528763cbe6fc6f505425d637 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 2 Jun 2024 08:08:05 -0400 Subject: [PATCH] autohotkey v2 for windows --- windows/autohotkey/RemapCapsCtrlEscapeV2.ahk | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 windows/autohotkey/RemapCapsCtrlEscapeV2.ahk diff --git a/windows/autohotkey/RemapCapsCtrlEscapeV2.ahk b/windows/autohotkey/RemapCapsCtrlEscapeV2.ahk new file mode 100644 index 0000000..189894d --- /dev/null +++ b/windows/autohotkey/RemapCapsCtrlEscapeV2.ahk @@ -0,0 +1,24 @@ +#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}" + } +} \ No newline at end of file