Jump to content
Sign in to follow this  
Cumberland Mike

Very newbie question

Recommended Posts

Cumberland Mike

Is there a way to have AutoIt wait for a mouse click then it would proceed to close the open window and ... move on through the rest of the script.

I can not find out how to have it recognize a mouse click ... the pointer is not imprtant ... nor is its position ... just need to recognize the click ... and move on

Any help is greatly appreciated

TIA

Mike

Share this post


Link to post
Share on other sites
buzz44

While 1
   $msg = GUIGetCursorInfo ()
   If $msg[2] = 1 Then
      MsgBox(4096,"Test","You pressed the primary button.")
   ElseIf $msg[2] = 1 And $msg[3] = 1 Then
      MsgBox(4096,"Test","You pressed the primary and secondary buttons.")
   ElseIf $msg[2] = 1 Or $msg[3] = 1 Then
      MsgBox(4096,"Test","You pressed the primary or secondary buttons.")
   EndIf
Wend

Or you can use GUIGetMsg()

While 1
   $msg = GUIGetMsg()
   If $msg = $GUI_EVENT_PRIMARYDOWN Then
      MsgBox(4096,"Test","You pressed the primary button.")
   ElseIf $msg = $GUI_EVENT_PRIMARYDOWN And $msg = $GUI_EVENT_SECONDARYDOWN Then
      MsgBox(4096,"Test","You pressed the primary and secondary buttons.")
   ElseIf $msg = $GUI_EVENT_PRIMARYDOWN Or $msg = $GUI_EVENT_SECONDARYDOWN Then
      MsgBox(4096,"Test","You pressed the primary or secondary buttons.")
   EndIf
Wend

GUIGetMsg() has more options such as.

  • $GUI_EVENT_PRIMARYDOWN
  • $GUI_EVENT_PRIMARYUP
  • $GUI_EVENT_SECONDARYDOWN
  • $GUI_EVENT_SECONDARYUP
Edited by Burrup

qq

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.