Jump to content

How to get the mouse wheel movement value?


Cheblon
 Share

Recommended Posts

Is there a way to get the value of how much the mouse wheel has been moved? For example, a command that returned a value of -2 could mean the mouse wheel has been moved two ticks downwards.

I've been searching the forums and the help but cannot find anything on this.

Any help would be great, thank you.

Link to comment
Share on other sites

That is a good question.

Look in the help file under mouse MouseClick. It might be registered with middle button. I have not used or seen anything with the wheel here.

Good luck!

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Just had a look round, have a look at here and 1888 here.

Also look at the MouseWheel function.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

You are looking for the following function:

_WinAPI_Mouse_Event

See the help file and the MSDN for more detail on how to use it.

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Link to comment
Share on other sites

Neither MouseWheel nor _WinAPI_Mouse_Event can be of help to get the amount of wheel scrolling been preformed. If it's your GUI you can process the WM_MOUSEWHEEL (0x020A) and check the hi-word of $wParam to see if it's positive value (wheel up) or negative value (wheel down) both contain a multiple of 120.

Link to comment
Share on other sites

If its a loop running and your curious how many times its rolling the wheel to complete what you scripted the loop to do...

You could simply add a $var + 1 after each succesful loop and msgbox when it comes up.

If this is not the case:

You can also just use the on_event commands and use the same idea adding 1 to a var and triggering a msgbox() or the like to display the information.

Link to comment
Share on other sites

Thank you Drew, it is loop driven and i have already implemented the $var + 1. Manadar's link to a low level mouse hook was a good way of testing which way the mouse wheel and been turned. Suggest anyone wanting to do the same thing to check it out too.

Thanks for everyone's help on this problem :)

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