Jump to content
Sign in to follow this  

mouse button

Recommended Posts


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")

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

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



My Android cat and mouse game

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  


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.