When I check 'Key History And Info', I see that Wheel events are not getting picked up by the script ALTHOUGH Mouse Hook and Keyboard Hook are both installed (active on script).
In the picture above, the AHK window 1, is a script that I just started, and is able to see the Wheel events.
And the AHK window 2, is a script that has been running for some hours, and is not able to see the wheel events.
Here's how my code looks like:
Code: Select all
GroupAdd, Games, ahk_class LWJGL
GroupAdd, Games, ahk_class Valve001
GroupAdd, Games, ahk_class UnrealWindow
GroupAdd, Games, ahk_exe Steam.exe
GroupAdd, Games, ahk_exe h1z1.exe
GroupAdd, Games, ahk_exe Realm.exe
GroupAdd, Games, ahk_exe hl2.exe
CheckMousePosition(){
CoordMode, Mouse, Screen
MouseGetPos , MouseXFullScreenHotkey, MouseYFullScreenHotkey
If (MouseXFullScreenHotkey > 1915) AND (MouseYFullScreenHotkey < 5)
return 2
Else If (MouseXFullScreenHotkey < 5) AND (MouseYFullScreenHotkey < 5)
return 1
Else
return 0
}
#If !WinActive("ahk_group Games") AND CheckMousePosition() = 1
WheelUp::run A:\nircmd-x64\nircmd.exe changebrightness +10
WheelDown::run A:\nircmd-x64\nircmd.exe changebrightness -10
#If !WinActive("ahk_group Games") AND CheckMousePosition() = 2
WheelUp::Volume_Up
WheelDown::Volume_Down
#If