Sign in to follow this  
Followers 0
Dizzydbd

How can i assing a Mouse Click

3 posts in this topic

It is posible to assing Mouse Click using this function ?

HotKeySet("", "")

I mean when i do right/left click a function to start :)

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

Thx alot

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