i want make my ahk script pause or suspend when some games active or running.
i tried
#IfWinActive Notepad
Suspend
#If
but it not working
how make ahk pause / suspend when some program run
-
- Posts: 1
- Joined: 17 Apr 2018, 22:09
Re: how make ahk pause / suspend when some program run
you can use WinWait to detect when your game starts.
Re: how make ahk pause / suspend when some program run
it depends what your script does, if it's a bunch of hotkeys then I would use a timer
Code: Select all
#persistent
#singleinstance Force
SetTimer, Check, 500
Check:
If WinActive("ahk_exe notepad.exe") and (!A_IsSuspended)
Suspend, On
If !WinActive("ahk_exe notepad.exe") and (A_IsSuspended)
Suspend, Off
return
!a:: ;alt+a
MsgBox, Hello, World!
return
Re: how make ahk pause / suspend when some program run
If all you need is to selectively disable certain hotkeys why go with through all this ceremony of setting up timers, simply declare your hotkeys inside your #If directive.
If you need to pause a script thats a different thing entirely, so which one is it?
If you need to pause a script thats a different thing entirely, so which one is it?
Who is online
Users browsing this forum: Descolada, marypoppins_1 and 74 guests