Help with disabling mouse wheel directions

Discussion, questions and support.
Post Reply
NW5o4vTsxVyAY4AY
Posts: 32
Joined: Feb 5th, ’19, 14:11

Post by NW5o4vTsxVyAY4AY » Aug 15th, ’23, 13:04

Hi,

I'm looking for a way to disable one mouse wheel direction while the opposite direction is being used, i.e. disable WheelUp while using WheelDown and vice versa.

The reason is that I experience a "scroll jumping" issue that doesn't seem to be directly hardware or software related, it's just that my mouse wheel is quite sensitive when scrolling quickly.

I've tried approaching the issue with a couple of different script ideas but nothing worked, or only partially.

Any ideas would be appreciated.


Cheers
User avatar
Marko
Posts: 1681
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Aug 15th, ’23, 21:35

Create two shortcuts: WheelUp and WheelDown with the following script (Type: Command)

Code: Select all

If (A_ThisHotkey=A_PriorHotkey)
   Send {%A_ThisHotkey%}
return
NW5o4vTsxVyAY4AY
Posts: 32
Joined: Feb 5th, ’19, 14:11

Post by NW5o4vTsxVyAY4AY » Aug 19th, ’23, 11:58

Thanks for your suggestion, it works well and reduces the "scroll jumping" issue at least a bit for me.

If you used a different shortcut before, the first time you want to scroll in one direction you have to scroll twice for it to trigger (I assume because the first scroll is needed to define "A_ThisHotkey=A_PriorHotkey"?).
But that's no problem for me because I rarely scroll only once anyway.

Thanks again and best regards.
Last edited by NW5o4vTsxVyAY4AY on Nov 16th, ’23, 06:33, edited 1 time in total.
User avatar
Marko
Posts: 1681
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Aug 20th, ’23, 20:38

You are correct, this was the measure I used to prevent the issue. There may be other, more complicated methods.
NW5o4vTsxVyAY4AY
Posts: 32
Joined: Feb 5th, ’19, 14:11

Post by NW5o4vTsxVyAY4AY » Nov 18th, ’23, 11:05

Sorry for the bump, but I looked into my issue some more and found a different solution that works great for my needs so far.

Perhaps I didn't explain the issue clearly enough before. While physically scrolling the mousewheel several notches in one direction in quick succession, it would occasionally jump one or more notches in the other direction (here's a gif showing it happening while I'm physically scrolling only down, never up).

So I needed a way to be able to quickly scroll in one direction while making scrolling into the opposite direction temporarily impossible, but without breaking the ability to switch scroll directions without hassle.
Anyway, the solution turned out to be much simpler than I thought:

Shortcut: WheelUp
Command:

Code: Select all

If (A_PriorHotkey="WheelDown" AND A_TimeSincePriorHotkey<=100)
   Sleep 100
Else
   Send {WheelUp}
Return
Shortcut: WheelDown
Command:

Code: Select all

If (A_PriorHotkey="WheelUp" AND A_TimeSincePriorHotkey<=100)
   Sleep 100
Else
   Send {WheelDown}
Return
Thanks again for all your support.
Post Reply