I have a wireless mouse.. so i changed the code to be able to control volume when watching videos on my laptop. I need to be able to control volume only using my mouse.
The code below works fine, but it triggers the LButton and RButton actions also. If i remove the tilde, i lose the LButton and RButton of my mouse (I cannot click anything then). Any solutions are appreciated.
Code:
~LButton & WheelUp:: ;Increase wav volume OSD
Type = W
~RButton & WheelUp:: ;Increase master volume OSD
#MaxHotkeysPerInterval 50
IfNotEqual, Type, W
{
SoundSet, +4
SoundGet, currsnd
}
IfEqual, Type, W
{
SoundSet, +4, Wave
SoundGet, currsnd, Wave
}
mark=0
curr=%EmptyBar%
loopup:
mark += 4
iflessorequal,mark, %currsnd%,StringReplace, curr, curr,%Empty%,%Full%
iflessorequal,mark, %currsnd%, goto, loopup
gosub, display
return
~LButton & WheelDown:: ;Decrease wav volume OSD
Type = W
~RButton & WheelDown:: ;Decrease master volume OSD
#MaxHotkeysPerInterval 50
IfNotEqual, Type, W
{
SoundSet, -4
SoundGet, currsnd
}
IfEqual, Type, W
{
SoundSet, -4, Wave
SoundGet, currsnd, Wave
}
mark=0
curr=%EmptyBar%
loopdown:
mark += 4
iflessorequal,mark, %currsnd%,StringReplace, curr, curr,%Empty%,%Full%
iflessorequal,mark, %currsnd%, goto, loopdown
gosub, display
return