これでうまくいくことを願っています。
!a:: ; Alt+a to start script
Loop
{ ; Start of loop
GetKeyState, keystate, Pause, P ; Get the state of the Pause key
if keystate = D ; The Pause key was held down, break out of the loop.
break ; Stop loop when the Pause key was held down
Send, {Space Down} ; This will NOT autorepeat
Sleep 2000 ; Wait 200 ms
Send, {Space Up} ; Release the key
GetKeyState, keystate, Pause, P ; Get the state of the Pause key
if keystate = D ; The Pause key was held down, break out of the loop.
break ; Stop loop when the Pause key was held down
Send, {b Down} ; This will NOT autorepeat
Sleep 2000 ; Wait 200 ms
Send, {b Up} ; Release the key
GetKeyState, keystate, Pause, P ; Get the state of the Pause key
if keystate = D ; The Pause key was held down, break out of the loop.
break ; Stop loop when the Pause key was held down
MouseClick, left, 150,150 ; Click the mouse at 150X,150Y pixels, check exact mouse coordinates with AHK Window Spy
} ; End of loop
return ; End of script
PS各キーの後にBreakトラップを追加する代わりに、exitappを実行するためのホットキーを追加することもできます。