Scroll (on the taskbar) to try it out
Script:
Revision 3 - [r3]
Spoiler
Screenshots:
Code: Select all
/*
Based on the example from: http://l.autohotkey.net/docs/commands/_If.htm
parts "forked" from Update.ahk
----------------------------------------
This version, joedf, April 8th, 2013
- Update May 23rd, 2013 [r1] - Added Tooltip to display volume %
- Update June 4th, 2013 [r2] - Added Volume OSD
- Update June 6th, 2013 [r3] - Added Hotkeys & over_tray options, Suggested by DataLife
*/
;_______[Settings]_______
Volume_Delay:=1000
BG_color=1A1A1A
Text_color=FFFFFF
Bar_color=666666
Volume_OSD_Center:=1
over_tray:=1
;________________________
;________[HOTKEYS]_______
vol_up = WheelUp
vol_down = WheelDown
vol_up_fast = +%vol_up% ;shift + (vol_up) hotkey
vol_down_fast = +%vol_down% ;shift + (vol_down) hotkey
;________________________
;//////////////[Do not edit after this line]///////////////
#If % (over_tray) ? MouseIsOver("ahk_class Shell_TrayWnd") : "(1)"
Hotkey, If, % (over_tray) ? MouseIsOver("ahk_class Shell_TrayWnd") : "(1)"
Hotkey,%vol_up%,vol_up
Hotkey,%vol_down%,vol_down
Hotkey,%vol_up_fast%,vol_up_fast
Hotkey,%vol_down_fast%,vol_down_fast
return
vol_up:
Send {Volume_Up}
gosub, Volume_Show_OSD
return
vol_up_fast:
Send {Volume_Up 4}
gosub, Volume_Show_OSD
return
vol_down:
Send {Volume_Down}
gosub, Volume_Show_OSD
return
vol_down_fast:
Send {Volume_Down 4}
gosub, Volume_Show_OSD
return
Volume_Show_OSD:
if (Volume_OSD_Center)
{
mY := (A_ScreenHeight/2)-26, mX := (A_ScreenWidth/2)-165
}
else
{
SysGet m, MonitorWorkArea, 1
mY := mBottom-52-2, mX := mRight-330-2
}
SoundGet, Volume
if (!Volume_OSD_c)
{
Volume_ProgressbarOpts=CW%BG_color% CT%Text_color% CB%Bar_color% x%mX% y%mY% w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11
Progress Hide %Volume_ProgressbarOpts%,,Volume,, Tahoma
Volume_OSD_c:=!Volume_OSD_c
}
Progress Show
Progress % Volume := Round(Volume), %Volume% `%
SetTimer, Remove_Show_OSD, %Volume_Delay%
return
Remove_Show_OSD:
SetTimer, Remove_Show_OSD, Off
Progress Hide %Volume_ProgressbarOpts%,,Volume,,Tahoma
return
MouseIsOver(WinTitle) {
MouseGetPos,,, Win
return WinExist(WinTitle . " ahk_id " . Win)
}
Spoiler
Cheers!
[wkr][/wkr]