else/AHK/volumecontrol.ahk

49 lines
833 B
AutoHotkey
Raw Normal View History

2017-07-23 17:52:21 +00:00
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Alt-F11, Alt-F12 = sound down and up
2017-08-26 03:03:12 +00:00
; WINDOWS 7 USERS: You need
; `Send {Volume_Up}` instead of `SoundSet +5` and
; `Send {Volume_Down}` instead of `SoundSet -5`.
; The `SoundSet, +1, , mute` will still work okay.
vol_down(amount)
2017-07-23 17:52:21 +00:00
{
2017-08-26 03:03:12 +00:00
SoundSet -%amount%
2017-07-23 17:52:21 +00:00
return
}
2017-08-26 03:03:12 +00:00
vol_up(amount)
2017-07-23 17:52:21 +00:00
{
2017-08-26 03:03:12 +00:00
SoundSet +%amount%
2017-07-23 17:52:21 +00:00
SoundGet, sound_mute, Master, mute
if sound_mute = On
{
2017-08-26 03:03:12 +00:00
SoundSet, +0, , mute
2017-07-23 17:52:21 +00:00
}
return
}
2017-08-26 03:03:12 +00:00
!F11::
{
vol_down(5)
return
}
+!F11::
{
vol_down(1)
return
}
!F12::
{
vol_up(5)
return
}
+!F12::
{
vol_up(1)
return
}