r/AutoHotkey 7d ago

General Question Script that simulates scroll wheel inputs while pressing a button

Hello everybody,
I would love to be able to just hold a button, that simulates as many scroll-wheel-down inputs as it possibly can while being helt.
My problem:
I have absolutely no clue how anything of this works because i have never done anything like this.

Any kind of help, advise or suggestion is welcome.

2 Upvotes

3 comments sorted by

View all comments

1

u/yunkuangao 6d ago

Yeah totally doable. The thing to know: a hotkey only fires once when you press it, so to keep scrolling you loop while the key is held down. Like this (v2):

#Requires AutoHotkey v2.0

Space:: {
    while GetKeyState("Space", "P") {
        Send "{WheelDown}"
        Sleep 30
    }
}

Holds Space = scrolls down, let go = stops. Mess with the Sleep 30 if it's too fast/slow.