I have the following code to bring up a settings menu for an AHK game I'm making:
Code: Select all
~lbutton::
MousegetPos, xpos, ypos
if (ypos < 100) and (xpos < 100)
if (A_PriorHotkey == A_ThisHotkey AND A_TimeSincePriorHotkey < 350)
Settings()
return
I wanted to pause the game so after creating the settings GUI I put:
Code: Select all
Gui, 10:show, AutoSize, Current Settings
WinWaitActive, Current Settings ; wait for the 'last found window' (i.e. the Gui) to be active
WinWaitClose, Current Settings ; wait for the 'last found window' (i.e. the Gui) to be destroyed
GoSub Restart
The problem is that if I use WinWaitClose the left mouse click only brings up the Settings Menu once. If I don't use WinWaitClose I can call up the Settings menu multiple times but then I can't pause the game. I've tried setting CoordMode to both screen and active window but it hasn't made a difference. Why does left click stop working if I use WinWaitClose? Thanks