Prevent accidental jumps on scroll wheel script.

Ask gaming related questions
AriesGOSU
Posts: 6
Joined: 06 Jun 2018, 10:46

Prevent accidental jumps on scroll wheel script.

30 Jun 2020, 13:33

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! :)
Last edited by BoBo on 02 Jul 2020, 11:11, edited 1 time in total.
Reason: Moved to Gaming section.
BobbitWormJoe
Posts: 5
Joined: 30 Jun 2020, 13:09

Re: Prevent accidental jumps on scroll wheel script.

30 Jun 2020, 14:52

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.
AriesGOSU
Posts: 6
Joined: 06 Jun 2018, 10:46

Re: Prevent accidental jumps on scroll wheel script.

01 Jul 2020, 11:45

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.
BobbitWormJoe
Posts: 5
Joined: 30 Jun 2020, 13:09

Re: Prevent accidental jumps on scroll wheel script.

02 Jul 2020, 16:38

Considering it's a multiplayer game, AHK might be blocked by anti-cheat.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 24 guests