AutoHotkey Community

It is currently May 26th, 2012, 12:03 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Mouse wheel speed
PostPosted: April 12th, 2006, 4:38 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Does anyone know how to set the scrolling speed of the mouse wheel from AHK? TweakUI allows setting it, but at the next boot it gets back to the default 3 lines at a time.

Also, even though I set 1 line scrolling at a time, many applications scroll 3 lines, anyway. MS Word and MSIE honors the TweakUI setting, others ignore it. Is there a more general way of setting the scroll speed, than what TweakUI uses? The following does not seem to have any effect
Code:
RegWrite REG_SZ, HKEY_CURRENT_USER, Control Panel\Desktop, WheelScrollLines, 1
RegWrite REG_SZ, HKEY_USERS, .DEFAULT\Control Panel\Desktop, WheelScrollLines, 1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 5:49 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
I played around with it a little while back. I noticed that notepad seems to ignore the scroll wheel settings and always scrolls 3 lines, so probably some programs handle the number of lines to scroll themselves.

Code:
; retrieve original scroll wheel setting
; #define SPI_GETWHEELSCROLLLINES    0x68
DllCall("SystemParametersInfo", UInt, 0x68, UInt, 0, UIntP, Scroll_Lines, UInt, 0)


; set new value
; #define SPI_SETWHEELSCROLLLINES    0x69
Scroll_Lines_Accel := 6
DllCall("SystemParametersInfo", UInt, 0x69, UInt, Scroll_Lines_Accel, UInt, 0, UInt, 0)




I've been messing around to accelerate the scroll wheel with the new A_EventInfo for the wheel too (works quite well along with KatMouse):

Code:
; #define SPI_GETWHEELSCROLLLINES    0x68
; #define SPI_SETWHEELSCROLLLINES    0x69

SetMouseDelay, -1
DllCall("SystemParametersInfo", UInt, 0x68, UInt, 0, UIntP, Scroll_Lines, UInt, 0)
OnExit, Clean_Up
return

WheelUp::
  Critical
  If A_EventInfo =1
    Scroll_Lines_Accel := Scroll_Lines
  Else If  A_EventInfo =2
    Scroll_Lines_Accel := Scroll_Lines * A_EventInfo * A_EventInfo
  Else If  A_EventInfo >2
    Scroll_Lines_Accel := Scroll_Lines * A_EventInfo * A_EventInfo * A_EventInfo
  DllCall("SystemParametersInfo", UInt, 0x69, UInt, Scroll_Lines_Accel, UInt, 0, UInt, 0)
  Send, {WheelUp}
return

WheelDown::
  Critical
  If A_EventInfo =1
    Scroll_Lines_Accel := Scroll_Lines
  Else If  A_EventInfo =2
    Scroll_Lines_Accel := Scroll_Lines * A_EventInfo * A_EventInfo
  Else If  A_EventInfo >2
    Scroll_Lines_Accel := Scroll_Lines * A_EventInfo * A_EventInfo * A_EventInfo
  DllCall("SystemParametersInfo", UInt, 0x69, UInt, Scroll_Lines_Accel, UInt, 0, UInt, 0)
  Send, {WheelDown}
return



Clean_Up:
  DllCall("SystemParametersInfo", UInt, 0x69, UInt, Scroll_Lines, UInt, 0, UInt, 0)
  Exitapp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 5:50 pm 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
Öhm, that sounds easy, you want to use AHK to change Mouse-wheel speed?
Code:
Speed = 5     ;Enter here the lines to move up or dow, if wheel is turned

WheelUp::MouseClick, WheelUp, , , %Speed%
WheelDown::MouseClick, WheelDown, , , %Speed%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 5:57 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
@ garath:
I'd overlooked that one, but it's not quite the same:
Quote:
ClickCount is the number of notches to turn the wheel
- so it will be a multiple of the number of lines the wheel is set to scroll.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 6:09 pm 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
@evl
Hmm, you are right, it would only speed up movement, so DLLcalls seem to be the only way to solve this problem.
Sadly, I am not DLL-proof :cry:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 6:51 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Thanks, evl! The dll call seem to have the same effects as TweakUI.
evl wrote:
Code:
DllCall("SystemParametersInfo", UInt, 0x69, UInt, Scroll_Lines_Accel, UInt, 0, UInt, 0)
Now I can set 1-line scrolling in my start-up script.

I found that Windows handles the acceleration pretty well, I don't have to change the scrolling speed. In Control Panel / Mouse I set what I want, and Windows changes temporarily the scrolling lines, if many wheel events are received in a short time.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 7:09 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
Quote:
and Windows changes temporarily the scrolling lines, if many wheel events are received in a short time
- are you sure it's doing that? As far as I'm aware Windows doesn't change the wheel lines setting itself or accelerate in any way (it just reacts to the number of wheel events - certainly seems to be the case with the default of 3 lines per scroll). Maybe you are running some software/drivers from the mouse's manufacturer that do this?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 7:20 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
You're right, I use MS IntelliPoint 5.2, which came with my Bluetooth keyboard/mouse combo. The acceleration settings are in there (or in the mouse driver - you cannot tell them appart), I just assumed it was a Windows feature. But it accelerates really well. You could give it a try...


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 20th, 2006, 12:24 pm 
Offline

Joined: December 20th, 2006, 11:57 am
Posts: 1
garath wrote:
Öhm, that sounds easy, you want to use AHK to change Mouse-wheel speed?
Code:
Speed = 5  ;lines to [scroll]
WheelUp::MouseClick, WheelUp, , , %Speed%
WheelDown::MouseClick, WheelDown, , , %Speed%


Holy freakin thank you! I had hitherto been using a horridly clunky piece of scriptage, which was not capable of much accelleration—apparently due to limited responsiveness:
Code:
$WheelUp::
$WheelDown::%A_TimeSincePriorHotkey% %A_ThisHotkey% %B_ThisHotkey%
    StringReplace, B_ThisHotkey, A_ThisHotkey, $,
    sendinput {%B_ThisHotkey%}
    if A_PriorHotkey = %A_ThisHotkey%
        if A_TimeSincePriorHotkey < 70
            sendinput {%B_ThisHotkey%}{%B_ThisHotkey%}
return


I'd glanced at MouseClick, but it hadn't sunk in how to use it. Now, thanks to your sample, i have a new blob, which performs on par with the acceleration that IntelliPoint had been providing, before i (prompted by a need to upgrade to 5, to support a USB mouse) decided to get its bloated, home-phoning hide the beep out of my computer.
Code:
$WheelUp::
$WheelDown::
    StringReplace B_ThisHotkey, A_ThisHotkey, $,
    B_WheelStep = 1
    if A_PriorHotkey = %A_ThisHotkey%
        if A_TimeSincePriorHotkey < 70
            B_WheelStep = 3
    MouseClick %B_ThisHotkey%,,,%B_WheelStep%
return


(I'll may add another level of accelleration, later. But for now, this kicks!)

[Side note: I'm using nested if because and was totally not working. (1.0.44.12)]

_________________
Irgendwo über dem Regenbogen


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 20th, 2006, 3:00 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
überRegenbogen wrote:
I'm using nested if because and was totally not working. (1.0.44.12)]
It works for me. Have you forgotten the parentheses? Try this
Code:
WheelUp::
WheelDown::
    if (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < 70)
         MouseClick %A_ThisHotkey%,,,3
    else MouseClick %A_ThisHotkey%
return


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 21st, 2006, 7:54 am 
Ah ha! I'd managed to get confused about if var vs if (expression). I think i tried it once, but put the %% around the var name. Crazy crazy syntax this thing has--but one hell of a capable tool!

I see that you whitled yet more fat out of my blob. Cool! I didn't think far enough to realize that i didn't need the $ prefix anymore. :) (The B_WheelStep variable was in thinking toward a more sophisticated accelleration curve, but that can wait.)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2008, 11:50 pm 
Offline

Joined: November 25th, 2004, 10:08 am
Posts: 57
Laszlo wrote:
Thanks, evl! The dll call seem to have the same effects as TweakUI.
evl wrote:
Code:
DllCall("SystemParametersInfo", UInt, 0x69, UInt, Scroll_Lines_Accel, UInt, 0, UInt, 0)
Now I can set 1-line scrolling in my start-up script.

I found that Windows handles the acceleration pretty well, I don't have to change the scrolling speed. In Control Panel / Mouse I set what I want, and Windows changes temporarily the scrolling lines, if many wheel events are received in a short time.


I realize I'm resurrecting an old thread, but I'm trying to solve the problem of my laptop's touchpad scrolling being too sensitive compared to the scrollwheel on my bluetooth mouse so I need to change the scrollwheel speed from 1 to 3 depending on which I'm using. Ideally, it would be nice for this to occur automatically, but I don't mind launching a script manually. I've tried the above suggestion and it works

However, it seems most applications don't see the change unless they are closed and restarted, which can be a pain. Is there any way to force the change to occur immediately?

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 15th, 2008, 8:35 pm 
Offline

Joined: October 29th, 2006, 4:09 am
Posts: 39
Location: A2 MI
tinaa wrote:
Laszlo wrote:
Thanks, evl! The dll call seem to have the same effects as TweakUI.
evl wrote:
Code:
DllCall("SystemParametersInfo", UInt, 0x69, UInt, Scroll_Lines_Accel, UInt, 0, UInt, 0)
Now I can set 1-line scrolling in my start-up script.

I found that Windows handles the acceleration pretty well, I don't have to change the scrolling speed. In Control Panel / Mouse I set what I want, and Windows changes temporarily the scrolling lines, if many wheel events are received in a short time.


I realize I'm resurrecting an old thread, but I'm trying to solve the problem of my laptop's touchpad scrolling being too sensitive compared to the scrollwheel on my bluetooth mouse so I need to change the scrollwheel speed from 1 to 3 depending on which I'm using. Ideally, it would be nice for this to occur automatically, but I don't mind launching a script manually. I've tried the above suggestion and it works

However, it seems most applications don't see the change unless they are closed and restarted, which can be a pain. Is there any way to force the change to occur immediately?

Thanks!


Maybe set the default to 1 line and multiply by 3 when needed? I think that might get around the app restarts necessitated by bluetooth.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2008, 8:49 pm 
Offline

Joined: June 11th, 2005, 9:34 am
Posts: 264
Location: England ish
good idea.

_________________
::
I Have Spoken
::


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 30th, 2009, 10:19 pm 
Offline

Joined: June 8th, 2006, 10:17 pm
Posts: 36
Is it possible to add momentum to the scroll wheel? ie.. if I'm scrolling
slowly with the wheel, the speed should be about what evl's script produced (scrolling lines quickly); if I'm moving the wheel quickly, it should fly through and be scrolling by pages.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group