Jump to content

Do something when button is clicked


sen21
 Share

Recommended Posts

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

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
 Share

  • Recently Browsing   0 members

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