Jump to content

Wait for mouse click then do something


Newb
 Share

Go to solution Solved by 5471665561,

Recommended Posts

Hi everyone,

How can I wait for a user mouseclick anywhere, then do something after he clicked?

IE:

 

While (Mouseclick == false)

Sleep(10)

Wend

Do something because mouse has been clicked

I've seen that you can check with _IsPressed, but how you can treat it like an event?

Thanks

Edited by Newb

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

  • Solution

$dll = DllOpen("user32.dll")

While NOT _IsPressed("01", $dll)    
   Sleep (50)
WEnd
;do stuff

DllClose($dll)
Something like this or am I mis-interpretting? Also you need to include the Misc.au3 library...forums were not letting me properly include it.

Edited by Durnt
Link to comment
Share on other sites

Yeah, that is it. But I will have to try it. I have the suspect that a Sleep(50) will cause some clicks to miss if done while script is in Sleep. Better 10 ms sleep.

Anyway shame on me for missing such a simple code.

Thanks Durnt, cheers!

 

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

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