Jump to content

mouse button


 Share

Recommended Posts

it may have been _IsPressed? (#Include <Misc.au3> and it uses 04) you may have to get creative with dlls to get buttons 4 and 5 though)

This is for the mouse wheel:

Global $mouseEvent=0
$hM_Module = DllCall("kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0)
$hM_Hook = DllCall("user32.dll", "hwnd", "SetWindowsHookEx", "int", 14, "ptr", DllCallbackGetPtr(DllCallbackRegister("_Mouse_Proc", "int", "int;ptr;ptr")), "hwnd", $hM_Module[0], "dword", 0)

While 1
If $mouseEvent = 120 Then
        MsgBox(0,"Mouse Event", "Mouse was scrolled up")
        $mouseEvent=0
    EndIf

    If $mouseEvent = -120 Then
        MsgBox(0,"Mouse Event", "Mouse was scrolled down")
        $mouseEvent=0
    EndIf
Sleep(10)
WEnd

Func _Mouse_Proc($nCode, $wParam, $lParam)
    $mouseData = DllStructGetData(DllStructCreate("int X;int Y" & ";dword mouseData", $lParam), 3)
    If $wParam = 0x020A Then $mouseEvent = BitShift($mouseData, 16)
EndFunc   ;==>_Mouse_Proc

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

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