Jump to content

Events?


Recommended Posts

Is there a way to either, set a mouse button to a hotkey, or find out when a mouse button is clicked?

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Link to comment
Share on other sites

  • Moderators

Beta _IsPressed('01') (Left button) _IsPressed('02') (Right Button)

Just put your condition statement in a loop.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Is that (function?) in an include? Sorry, I'm used to VB, but AutoIt is a lot simpler to do certain things.

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Link to comment
Share on other sites

  • Moderators

Here's an example:

dlibEnable('_AdlibManager', 10)

While 1
    Sleep(10000)
WEnd

Func _AdlibManager()
    _MouseFunctions('01', '02')
EndFunc

Func _MouseFunctions($vLeft, $vRight)
    If _IsPressed($vLeft) Then
        MsgBox(64, 'Info:', 'You pressed the left mouse button')
    ElseIf _IsPressed($vRight) Then
        MsgBox(64, 'Info:', 'You pressed the right mouse button')
    EndIf
EndFunc

Func _IsPressed($v_R, $v_dll = 'user32.dll')
    $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R)
    Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1
EndFunc   ;==>_IsPressed

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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