Skip to content

Instantly share code, notes, and snippets.

@conr
Last active August 7, 2023 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conr/fe0fbec5eb41d01d2099c7601a1ef946 to your computer and use it in GitHub Desktop.
Save conr/fe0fbec5eb41d01d2099c7601a1ef946 to your computer and use it in GitHub Desktop.
Remap LWin to LCtrl when Windows Terminal is focused (Auto Hot Key)
; Remap LWin to LCtrl when Windows Terminal is focused (Auto Hot Key)
#IfWinActive ahk_class CASCADIA_HOSTING_WINDOW_CLASS ; Check if Windows Terminal is active
LWin::LCtrl ; Remap left Windows key to left Ctrl key
#IfWinActive
; Script to assign alt+` and alt+escape the functionality to cycle through windows of the same application.
!`::
WinGetClass, OldClass, A
WinGet, ActiveProcessName, ProcessName, A
WinGet, WinClassCount, Count, ahk_exe %ActiveProcessName%
IF WinClassCount = 1
Return
loop, 2 {
WinSet, Bottom,, A
WinActivate, ahk_exe %ActiveProcessName%
WinGetClass, NewClass, A
if (OldClass <> "CabinetWClass" or NewClass = "CabinetWClass")
break
}
!Esc::
WinGetClass, OldClass, A
WinGet, ActiveProcessName, ProcessName, A
WinGet, WinClassCount, Count, ahk_exe %ActiveProcessName%
if (WinClassCount = 1)
return
Loop, 2 {
WinSet, Bottom,, A
WinActivate, ahk_exe %ActiveProcessName%
WinGetClass, NewClass, A
if (OldClass <> "CabinetWClass" or NewClass = "CabinetWClass")
break
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment