Jump to content

How do you detect if a mouse is pressed?


Recommended Posts

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
Link to comment
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)
Link to comment
Share on other sites

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