Jump to content

Recommended Posts

Posted

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

Posted

  Buey said:

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

Posted

  Saunders said:

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...