willichan

Check for mouse down

5 posts in this topic

#1 ·  Posted (edited)

Does anyone know of a way to check whether a mouse button is currently being pressed?

I have an application that I need to push out (some in-house thing that came from one of the overseas parent company offices. They think we want to sit down at each of hundreds of stations and do this manually.) that has an all graphic install interface (no detectable controls :ranting:  :censored:  :mad2: ), so I have to use mouse clicks to automate it.  The trouble is, that users keep trying to do other things durring the install.

As long as they are not pressing a mouse button, I can record their current mouse position, click where I need to, then put the mouse back.  If they have a button down when my script does a click, then things go out of whack.

Any ideas?

Edited by willichan

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Why not disable input with BlockInput, maybe put up a splash screen to let the end user know?

Edit: Sorry, missed the part where you said no Control functions, mouse only...

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

JLogan3o13:  That may be what I will have to do if I can't detect the mouse button.  It will cause a large number of complaints I would rather avoid, but it wouldn't be the first time I have had to take the heat for something forced down from the mother ship.

Edited by willichan

Share this post


Link to post
Share on other sites

 

?

#include <Misc.au3>
While 1
    For $i = 1 to 6
       If _IsPressed($i) Then msgbox(0,"", "a mouse button is pressed")
    Next
    Sleep(10)
WEnd

That worked!  Thanks.

I just have to make sure to skip button 3.  That seems to match ctrl-break.

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