Jump to content

Very newbie question


Recommended Posts

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

Link to comment
Share on other sites

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

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...