Binding wheel to a key

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Xyaan
Posts: 2
Joined: 23 Mar 2018, 05:07

Binding wheel to a key

23 Mar 2018, 05:31

I am new to autohotkey and have almost no knowledge on coding. I found this code where I will bind my NumpadAdd and NumpadSub to scroll up and down and It is not working. my mousewheel is broken that is why I am doing this.
The code is:

Code: Select all

#IfWinActive ahk_class RiotWindowClass

*NumpadAdd::
While GetKeyState("NumpadAdd", "p")
{
    SendInput, {WheelDown}
    Sleep 10 ; 1 second
}
return


*NumpadSub::
While GetKeyState("NumpadSub", "p")
{
    SendInput, {WheelUp}
    Sleep 10 ; 1 second
}
return
Can anyone tell me if there is a problem here?
Thanks!
Xyaan
Posts: 2
Joined: 23 Mar 2018, 05:07

Re: Binding wheel to a key

24 Mar 2018, 03:37

evilC wrote:#IfWinActive ahk_class RiotWindowClass makes this script only work while a certain window is active. Remove it if you want the remapping to work in all windows.
yeah but the thing is it is not working on the window itself and I know that it is the right window using the window spy.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 421 guests