shiby1510 0 Posted July 13, 2010 I can't figure out how to correctly write my script below. Once a hotkey that is set is pressed I want the function to send shift+P. If I click, I want it to then send shift+P. If I click again, I want it to send shift+I. If I press anything besides a mouseclick I want it to stop the function until the next time I press the hotkey. Here is what I have so far. Many Thanks! Func Yada() Send("^P") If _IsPressed('01') Then Sleep(50) Send ("^O") EndIf If _IsPressed('01') Then Sleep(50) Send("^I") EndIf EndFunc Func _IsPressed($HexKey) Local $AR, $bO $HexKey = '0x' & $HexKey $AR = DllCall("user32", "int", "GetAsyncKeyState", "int", $HexKey) If NOT @Error And BitAND($AR[0],0x8000) = 0x8000 Then Return 1 Return 0 EndFunc Share this post Link to post Share on other sites
Sobiech 0 Posted July 13, 2010 it looks like no loop for program stay alive I am sleeping, maybe i read the post badly ;[ This world is crazy Share this post Link to post Share on other sites