Sign in to follow this  
Followers 0
pikablue

How do you detect if a mouse is pressed?

5 posts in this topic

#1 ·  Posted (edited)

I'm making a autoit software to stop my lil cousin from playing around on my idled computer, it would automatically shut down when she click the mouse left button. or if anyone have any good idea.

why doesn't this work?

If _IsPressed("01")
    shutdown(6)
Endif

I have autoit running 24/7 i don't want her click the mouse or move the mouse or press any keys

i try blockinput() doesn't seem to work for me, i disabled UAC Too i'm vista

Edited by pikablue

Share this post


Link to post
Share on other sites



I'm making a autoit software to stop my lil cousin from playing around on my idled computer, it would automatically shut down when she click the mouse left button. or if anyone have any good idea.

why doesn't this work?

If _IsPressed("01")
    shutdown(6)
Endif

I have autoit running 24/7 i don't want her click the mouse or move the mouse or press any keys

i try blockinput() doesn't seem to work for me, i disabled UAC Too i'm vista

Hi! Try this.

#include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
   ;IF _IsPressed("02", $dll) Then shutdown(6)
    IF _IsPressed("02", $dll) Then MsgBox(16,"dbg","Mouse click detected")
WEnd
DllClose($dll)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

#include <Misc.au3>

While 1
   If _IsPressed("01") then
       Blockinput(1)
       Shutdown(5)  ;Force = 4, Shutdown = 1, your option (6) means force reboot. You wanted shutdown right.
    Endif
Wend

I would recommend reading up on your autoit it.

EDIT: I apologize for the incorrect code, but I couldn't update fast as I tested out my script and it shut off my computer.

Edited by Travis

Share this post


Link to post
Share on other sites

I would recommend you just lock the computer when you leave it.

You can set the screen saver to go back to the login screen so she won't be able to do anything.

That's a much cleaner solution.

Share this post


Link to post
Share on other sites

Thanks for all the advice, I just tried the DisableinPut method, i think that would be enough.

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