Jump to content
Sign in to follow this  
Newb

Wait for mouse click then do something

Recommended Posts

Newb

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.

Share this post


Link to post
Share on other sites
5471665561

$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

Share this post


Link to post
Share on other sites
Newb

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.

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  

×