sen21 0 Posted September 13, 2007 Hey I wanted my script to store the position of the mouse when the left mouse button is clicked. I know I am almost there but it's not running the function when the mouse gets pressed. Here's what I have: GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_getButtonPosition") Func _getButtonPosition() $mouse_pos = MouseGetPos() EndFunc I put a msg box in the _getButtonPosition method to see if it was even entering it or not, and it's not. Am I approaching this the wrong way or am I just doing something stupid? =) Thanks Share this post Link to post Share on other sites
narayanjr 0 Posted September 13, 2007 look up _IsPressed() Share this post Link to post Share on other sites
ofLight 1 Posted September 13, 2007 #Include <Misc.au3> Do Sleep(25) Until _IsPressed('01') $xy = MouseGetPos() MsgBox(0,"MouseCoOrds","X: "&$xy[0]&" Y: "&$xy[1]) There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Share this post Link to post Share on other sites
qazwsx 0 Posted September 13, 2007 i would recommend not using a do until loop they are slower than while loops. I think... Share this post Link to post Share on other sites
Buey 0 Posted September 13, 2007 Did you do: Opt("GUIOnEventMode",1) ? Share this post Link to post Share on other sites
sen21 0 Posted September 14, 2007 Did you do: Opt("GUIOnEventMode",1) ? Yeah, I did at the beginnng under my #include <GUIConstants.au3>. I guess I'll just use the do until loop. Thanks Share this post Link to post Share on other sites
therks 33 Posted September 14, 2007 Are you actually using a GUI? Cus GUISetOnEvent() is only going to capture mouse clicks on the GUI itself, otherwise yes, you will have to use _IsPressed(). My AutoIt Stuff | My Github Share this post Link to post Share on other sites
sen21 0 Posted September 14, 2007 Are you actually using a GUI? Cus GUISetOnEvent() is only going to capture mouse clicks on the GUI itself, otherwise yes, you will have to use _IsPressed().ahhh that would make sense. ok thanks everyone. Share this post Link to post Share on other sites