sen21 Posted September 13, 2007 Share 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 Link to comment Share on other sites More sharing options...
narayanjr Posted September 13, 2007 Share Posted September 13, 2007 look up _IsPressed() Link to comment Share on other sites More sharing options...
ofLight Posted September 13, 2007 Share 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 Link to comment Share on other sites More sharing options...
qazwsx Posted September 13, 2007 Share Posted September 13, 2007 i would recommend not using a do until loop they are slower than while loops. I think... Link to comment Share on other sites More sharing options...
Buey Posted September 13, 2007 Share Posted September 13, 2007 Did you do: Opt("GUIOnEventMode",1) ? Link to comment Share on other sites More sharing options...
sen21 Posted September 14, 2007 Author Share 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 Link to comment Share on other sites More sharing options...
therks Posted September 14, 2007 Share 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 Link to comment Share on other sites More sharing options...
sen21 Posted September 14, 2007 Author Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now