Jump to content

How can i assing a Mouse Click


Recommended Posts

While 1
    If _IsPressed(0x1) Then
        MsgBox(0,'', 'You pressed the left button!')
        ExitLoop
    EndIf
    Sleep(1)
WEnd

Func OnAutoItstart()
   Global $DllUser32 = DllOpen('user32')
EndFunc

Func OnAutoItExit()
   DllClose($DllUser32)
EndFunc

Func _IsPressed($hexKey)
  ; $hexKey must be the value of one of the keys.
  ; _IsPressed will return 0 if the key is not pressed, 1 if it is.
   
   Local $aR
   $aR = DllCall($DllUser32, "int", "GetAsyncKeyState", "int", $hexKey)
   If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
      Return 1
   Else
      Return 0
   EndIf
EndFunc  ;==>_IsPressed

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