A simple code I whipped up to toggle something. I'm currently trying to make this script work on a game like Fallout4 only when it is present. Pauses automatically when it loses focus on that window.
*RButton::
*Control::
*Shift::
while (GetKeyState("Ctrl", "T") ^ GetKeyState("Shift", "T"))
{
while (GetKeyState("RButton", "P"))
{
;Some Action
}
;Some Action
return
}
return
*F8::Suspend
*F9::Exitapp
SetTitleMatchMode, 2
#IfWinActive SomeApplication.exe
;Run This Script
#IfWinNotActive SomeApplication.exe
;Suspend+Pause This Script
return
Exit:
ExitApp
Return
I'm having trouble making this part work with Fallout4, it doesn't detect it at all but works well with notepad but I would have to manually execute the part after #IfWinActive
SetTitleMatchMode, 2
#IfWinActive ahk_exe Fallout4.exe
;Run THIS Script
#IfWinNotActive ahk_exe Fallout4.exe
;Suspend+Pause This Script