willichan Posted March 5, 2015 Posted March 5, 2015 (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 ), 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 March 5, 2015 by willichan My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash
Moderators JLogan3o13 Posted March 5, 2015 Moderators Posted March 5, 2015 (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 March 5, 2015 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Solution mikell Posted March 5, 2015 Solution Posted March 5, 2015 ? #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
willichan Posted March 5, 2015 Author Posted March 5, 2015 (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 March 5, 2015 by willichan My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash
willichan Posted March 5, 2015 Author Posted March 5, 2015 ? #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. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now