Jump to content
Sign in to follow this  
amino

Mouse scroll after mouse button released

Recommended Posts

amino

Hello my friends, I'm a big noob.

I want to make a script which scrolls up the mouse wheel one time and then scrolls down one time AFTER I released (not pressed) the right mouse button. 

Is this possible with AutoIt?

 

Thanks in advance

Share this post


Link to post
Share on other sites
TheXman
1 hour ago, amino said:

Is this possible with AutoIt?

Yes.  You could do it with a combination of _IsPressed to capture the right mouse being pressed and released and MouseWheel to do your scrolling up and down.  Look at the examples in the help file for details.  Not sure why you want to trigger it on the right mouse button since it triggers a context menu in most applications.

 

Here's a very simple example:

#include <Misc.au3>


example()

Func example()

    Local $hDll = DllOpen("user32.dll")

    While True
        Sleep(10)

        ;If right mouse button pressed
        If _IsPressed("02", $hDll) Then

            ;Wait until no longer pressed
            While _IsPressed("02", $hDll)
                Sleep(10)
            WEnd

            ;Do your action
            MsgBox(0, "Example", "Right mouse button released")
            ExitLoop

        EndIf
    WEnd

    DllClose($hDll)

EndFunc

 

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  

×