Sign in to follow this  
Followers 0
Cheblon

How to get the mouse wheel movement value?

11 posts in this topic

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.

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

I think u'll get what u need here..

U'll need to translate it to au3.. gool luck with that..


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
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]

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Thanks for all your help, still trying to work out exactly how to use the _WinAPI_Mouse_Event (as i came across it before)

If anyone can do me a really simple example of how to grab the mouse wheel value, would appreciate it!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thanks Authenticity and Manadar, this was more of the thing i was looking for :)

Share this post


Link to post
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.

Share this post


Link to post
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 :)

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