Is it possible to change or reduce the lines to scroll with the mouse wheel only while the Shift key, for example, is held down, or else the lines to scroll go back to their current setting in Windows?
If so, what's the script to accomplish this, please? I don't know where to even begin something like this.
Change lines to scroll while Shift key is held down? Topic is solved
Re: Change lines to scroll while Shift key is held down? Topic is solved
Code: Select all
#Requires AutoHotkey v2.0
+WheelUp::
+WheelDown::Send '{' SubStr(ThisHotkey, 2) ' 5}'
Re: Change lines to scroll while Shift key is held down?
Thank you very much for this code, mikeyww. Works like a charm.mikeyww wrote: ↑10 Jun 2023, 20:44Code: Select all
#Requires AutoHotkey v2.0 +WheelUp:: +WheelDown::Send '{' SubStr(ThisHotkey, 2) ' 5}'
By the way, one of the reasons I had to ask is that there doesn't seem to be a reference doc page for the WheelDown and WheelUp commands that clarifies that Send "{WheelDown 5}" or Send "{WheelUp 10}" is a thing. Even pages that show up after a search, like the Click page, don't clarify this. So, it's probably going to be helpful if the reference material administrators add a page and/or examples that explain this somewhere that a user can find with a relevant search.
Re: Change lines to scroll while Shift key is held down?
Oh, that is the repeat feature! I thought it was a feature unique to WheelDown and WheelUp to change the number of lines scrolled by the commands.
I've been guilty of forgetting about the key repeat feature (Click 2 is popular, I think) and one-dimensionally using only loop statements for repeating hotkeys. And I learned today from that reference page you linked that one might intentionally want to sometimes use loop statements instead of Send "{KeyName [Integer]}" if they wanted to simulate the "auto-repeat" driver/hardware behavior of physically holding down a key.
Thanks a lot for clarifying. If one sets up the lines scrolled to something low in the operating system's mouse settings, then one can certainly use such code to increase the scrolling speed while holding down a modifier key. Brilliant, even if I thought I wanted a different thing.
Re: Change lines to scroll while Shift key is held down?
All good.
1. Click 2 is different, as this uses the parameter for the Click function, not the syntax for the Send function (though these can be combined).
2. One reason to use Loop instead of Send {... n} on some occasions is if there is a need to break the loop upon certain conditions. This cannot generally be done easily with Send {... n}.
1. Click 2 is different, as this uses the parameter for the Click function, not the syntax for the Send function (though these can be combined).
2. One reason to use Loop instead of Send {... n} on some occasions is if there is a need to break the loop upon certain conditions. This cannot generally be done easily with Send {... n}.