Page 1 of 1

Prevent accidental jumps on scroll wheel script.

Posted: 30 Jun 2020, 13:33
by AriesGOSU
been searching around for a script like this and could not find one.

jumping with scroll wheel is very popular in games like CSGO, overwatch, valorant etc. but mice has this thing where it gets stuck between a "step" and "autoscroll" for one step randonly causing you to accidentaly jump.

is there a way to make a script that goes like follows:

if a scroll action is made, nothing will happen unles there is another within the 0.5 sec after.

so if i pull my finger down on the scroll it will most likly do 4-5 scroll actions. but if i just scroll one step, i want noting to happen.

this way it will fix the accidental scroll jumping when mouse get stuck in "middle of a scroll" since nothing will happen when it "unstuck" itself.


Hopefully i made my self understod, english is not my mother toung.

thanks in advance! :)

Re: Prevent accidental jumps on scroll wheel script.

Posted: 30 Jun 2020, 14:52
by BobbitWormJoe
Something like this should work. It will only send a scroll if it's been half a second or less since the last same scroll.

Code: Select all

WheelDown::
WheelUp::
If (A_PriorHotKey = A_ThisHotkey) && (A_TimeSincePriorHotkey <= 500)
	SendInput {%A_ThisHotkey%}
Return
You also might want to increase the #MaxHotkeysPerInterval and/or the #HotkeyInterval if you're going to be scrolling a lot, to prevent the related warning popup.

Re: Prevent accidental jumps on scroll wheel script.

Posted: 01 Jul 2020, 11:45
by AriesGOSU
This is perfect! thanks a ton! :)

now i just need to figure out this "ifwinactive" command to make it work only in-game.

i tryed this

Code: Select all

#If WinActive("ahk_exe VALORANT.EXE")
;; WheelDown::
WheelUp::
If (A_PriorHotKey = A_ThisHotkey) && (A_TimeSincePriorHotkey <= 500)
	SendInput {%A_ThisHotkey%}
Return



#MaxHotkeysPerInterval 2000
#HotkeyInterval 4000
but i cant make it work.

Re: Prevent accidental jumps on scroll wheel script.

Posted: 02 Jul 2020, 16:38
by BobbitWormJoe
Considering it's a multiplayer game, AHK might be blocked by anti-cheat.