Jump to content
Sign in to follow this  
Dizzydbd

How can i assing a Mouse Click

Recommended Posts

Dizzydbd

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
ezzetabi

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.