Jump to content


How can I decrease wheel scroll speed?


  • Please log in to reply
12 replies to this topic

#1 Kitaoka

Kitaoka
  • Guests

Posted 15 June 2012 - 11:01 AM

Hello. I managed to make a script that speed up wheel scroll speed,
+WheelUp::
Loop 4 
send,{WheelUp}
return

But, I can't find the way to reduce wheel scroll speed.
Please tell me how to. Thank you in advance.

#2 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 15 June 2012 - 12:26 PM

halfspeed := 0

+WheelUp::
If halfspeed
 send,{WheelUp}
halfspeed := !halfspeed
return
this should ignore every other notch in your wheel.

#3 Kitaoka

Kitaoka
  • Guests

Posted 15 June 2012 - 03:57 PM

halfspeed := 0

+WheelUp::
If halfspeed
 send,{WheelUp}
halfspeed := !halfspeed
return
this should ignore every other notch in your wheel.


Thank you for your advice, but does it stop scroll movement?
I tried to use it, and it stopped scroll. I want to slow down the scroll say, scroll number of lines 5 to 2.

#4 Alpha Bravo

Alpha Bravo
  • Members
  • 850 posts

Posted 15 June 2012 - 05:20 PM

why do you have to use a script for it, why not : control panel / mouse / wheel ?

#5 Kitaoka

Kitaoka
  • Guests

Posted 15 June 2012 - 06:06 PM

why do you have to use a script for it, why not : control panel / mouse / wheel ?


Because I want to set up the scroll speed individually like Opera is 2, Chrome is 5, and notepad is 10.
And yes I can set the basic speed as low as possible using Windows mouse setting, and make it first by my code but it takes tons of time,because there are few applications , for which I want to set scroll speed slow and fast. I need basic speed to be 5,which is suited for almost all applications I am using, so If I only use my code to adjust my mouse setting I have to make lots of scroll speed rules for over 50 applications that use medium "5" scroll speed setting.

#6 Alpha Bravo

Alpha Bravo
  • Members
  • 850 posts

Posted 15 June 2012 - 07:02 PM

use "window spy" to get control name and window name then use:
+WheelUp::

loop, 2		; adjust the no. 2 to control scroll speed

	PostMessage, 0x115,0,0,ControlName,WindowTitle				; vertical scroll up

return



+WheelDown::

loop, 2		; adjust the no. 2 to control scroll speed

	PostMessage, 0x115,1,0,ControlName,WindowTitle				; vertical scroll down

return


#7 Guests

  • Guests

Posted 17 June 2012 - 11:29 AM

use "window spy" to get control name and window name then use:

+WheelUp::
loop, 2		; adjust the no. 2 to control scroll speed
	PostMessage, 0x115,0,0,ControlName,WindowTitle				; vertical scroll up
return

+WheelDown::
loop, 2		; adjust the no. 2 to control scroll speed
	PostMessage, 0x115,1,0,ControlName,WindowTitle				; vertical scroll down
return


Thank you for your reply, but your script doesn't solve my problem.
I don't want to change basic scroll speed 5, and loop parameter in your script multiples "5",
it means I can't decrease the speed below 5.

#8 Kitaoka

Kitaoka
  • Guests

Posted 17 June 2012 - 11:30 AM

use "window spy" to get control name and window name then use:

+WheelUp::
loop, 2		; adjust the no. 2 to control scroll speed
	PostMessage, 0x115,0,0,ControlName,WindowTitle				; vertical scroll up
return

+WheelDown::
loop, 2		; adjust the no. 2 to control scroll speed
	PostMessage, 0x115,1,0,ControlName,WindowTitle				; vertical scroll down
return


Thank you for your reply, but your script doesn't solve my problem.
I don't want to change basic scroll speed 5, and loop parameter in your script multiples "5",
it means I can't decrease the speed below 5.


It's not guest. I forgot to write my name, sorry.

#9 Alpha Bravo

Alpha Bravo
  • Members
  • 850 posts

Posted 17 June 2012 - 03:48 PM

Thank you for your reply, but your script doesn't solve my problem.
I don't want to change basic scroll speed 5, and loop parameter in your script multiples "5",
it means I can't decrease the speed below 5.

There is no need to change basic scroll speed, PostMessage will scroll 1 line, loop will multiply 1's.
you could use #IfWinActive to have a window specific loop parameter.
SetTitleMatchMode, 2
#IfWinActive, Opera
+WheelUp::
ControlGetFocus, control, A
loop, 2
	SendMessage, 0x115, 0, 0, %control%, A  ; scroll up 1 line
return

+WheelDown::
ControlGetFocus, control, A
loop, 2
	SendMessage, 0x115, 1, 0, %control%, A ; scroll down 1 line
return
#IfWinActive


#10 JSLover

JSLover
  • Members
  • 920 posts

Posted 17 June 2012 - 04:19 PM

Because I want to set up the scroll speed individually like Opera is 2, Chrome is 5, and notepad is 10.

...easiest solution: set Windows to 1, then use a script to speed it up from there.

And yes I can set the basic speed as low as possible using Windows mouse setting...

...ohh, so you already thought of that.

...so If I only use my code to adjust my mouse setting I have to make lots of scroll speed rules for over 50 applications that use medium "5" scroll speed setting.

...you can use an else clause...just handle all the "specials" in an if / else if tree, then use one last else to handle "the rest" / the default setting.

There is no need to change basic scroll speed...

...that's good to know. However, you REALLY should've explained/used a var for 0x115, magic numbers make me itch...(plus, there's just no reason to be cryptic). Just assign 0x115 to the WM_* var it's related too...for example, WM_WTF:=0x115...

OMFG... :shock: ...I just found out this example (using 0x115) is in the damn AutoHotkey Docs!!!...the Docs are teaching people to use magic numbers... :cry: ...I don't know what to say. I'm soo ashamed of the AutoHotkey Docs now. :oops:

Alpha Bravo, Everyone: ignore the AutoHotkey Docs if the examples try to teach you badly...do not use magic numbers in new code & always fix them in any code you touch.

#11 Alpha Bravo

Alpha Bravo
  • Members
  • 850 posts

Posted 17 June 2012 - 05:30 PM

@JSLover:
Wow, thanks for your suggestions, I will cherish them.
I am not sure if you have a weird sense of humor, or just got up on the wrong side of the bed.
Either case I am sure you figured out what 0x115 means, it is in the “damn AutoHotkey Docs”, right !!!

#12 Gogo

Gogo
  • Guests

Posted 17 June 2012 - 06:48 PM

IMO the only way to scroll less then one notch is to use message 0x115 as Alpha Bravo suggested.
Unfortunately my Opera does not respond to the message 0x115 but it responds to keystrokes {UP} and {DOWN}.
Here is a script which recognizes the application under mouse cursor and using an if / else if tree (mentioned by JSLover) sends corresponding number of messages.
WheelUp::
WheelDown::
   MouseGetPos,,,win,hnd,3
   WinGetClass WinCl, ahk_id %win%
   If WinCl in Notepad,WordPadClass                          [color=#008000]; NotePad and WordPad - ten lines scroll[/color]
      loop 10
         PostMessage, 0x115, (A_ThisHotKey = "WheelDown"), 0,,ahk_id %hnd%
   else If WinCl in CabinetWClass,ExploreWClass              [color=#008000]; Explorer - two lines scroll[/color]
      loop 2
         PostMessage, 0x115, (A_ThisHotKey = "WheelDown"), 0,,ahk_id %hnd%
   else If WinCl in OpWindow                                 [color=#008000]; Opera - five keystrokes UP or DOWN[/color]
      ControlSend,, % (A_ThisHotKey = "WheelDown") ? "{Down 5}" : "{Up 5}", ahk_id %hnd%
   else                                                      [color=#008000]; any else app - one wheel notch[/color]
      ControlClick,, ahk_id %hnd%,, %A_ThisHotKey%, 1
return


#13 JSLover

JSLover
  • Members
  • 920 posts

Posted 18 June 2012 - 02:19 PM

Either case I am sure you figured out what 0x115 means...

...no, I didn't...looking up a "Windows Constant", to find its name (like WM_WTF) from a number is much harder than looking it up from the constant's name to its number.

I know the msg could be WM_VSCROLL or something like that, based on what the code should be doing, but I can't be sure (without alot of annoying searching, to find out {& 0x115 is just a number, so when searching, you will get many many irrelevant results}), since the Docs only demonstrate SendMessage, 0x115...but the docs should demonstrate using it correctly, by assigning 0x115 to some var (with the correct name), then using that var. That's the entire reason Windows Constant's exist...so people use the names.

Which do YOU think makes more sense?...

SendMessage, 0x115
...or...

WM_SOMEMSG:=0x115
SendMessage, WM_SOMEMSG
...I used WM_SOMEMSG here, since I didn't reverse-lookup 0x115 yet (since I shouldn't have to).

THAT is the reason I get soo mad about people (or the Docs) using "magic numbers". SendMessage, 0x115 doesn't say ANYTHING about what it MIGHT do. 0x115?...wtf is that??? At least when you assign the "magic number" to a var, with the correct name (from the Windows Constants)...people can have a clue as to what the code does.

Tell me, without looking it up...what do these do?

SendMessage, 0x119
SendMessage, 0x138
...you don't know!, do you? (yes, I just made up numbers, I don't know what they do -- or if they exist) This is the problem with magic numbers, no one knows what they do.

...it is in the “damn AutoHotkey Docs”, right !!!

...it is in the "damn AutoHotkey Docs" as 0x115...which means it doesn't tell me what it means.