Sign in to follow this  
Followers 0
Cumberland Mike

Very newbie question

2 posts in this topic

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



#2 ·  Posted (edited)

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

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

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  
Followers 0