Sign in to follow this  
Followers 0
MasonMill

mouse button

2 posts in this topic

I used a keyword a long time ago where i was able to use the third mouse button and i cant remember what it is. It was a tool kit i believe where i needed to use #include. Anyone know what it is? I'm trying to use mouse buttons 4 and 5. Thank you!

Share this post


Link to post
Share on other sites



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!

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