I use AutoHotkey as well. Here's what I use for media control:
AppsKey:: Send {AppsKey} ;Allow AppsKey (Menu key) to function normally if pressed by itself
AppsKey & Ins:: Send {Media_Play_Pause} ;Play/Pause
AppsKey & Del:: Send {Media_Stop} ;Stop
AppsKey & End:: Send {Media_Next} ;Next Track
AppsKey & Home:: Send {Media_Prev} ;Previous Track
AppsKey & PgUp:: Send {Volume_Up} ;Volume Up
AppsKey & PgDn:: Send {Volume_Down} ;Voume Down
AppsKey & BS:: Send {Volume_Mute} ;Toggle Mute On/Off
AppsKey is the "Menu" key. The AppsKey, for some reason, does not work without using the "&" function. Using & causes AHK to wait until an assigned combination of keys is pressed, effectively disabling the AppsKey for normal use and makes into an "Fn" key. The first line of code lets you use the key as normal. You can remove it if you want to disable the Menu key and only have it work when pressed with a matching hotkey.
OSD (on screen display) scripts are also available for volume control and media playback. This is a simple OSD for plain messages. But there are more complex ones for finding and display the volume level along with a volume bar.
OSD(text)
{
#Persistent
Progress, hide W400 b zh0 CW000000 FM16 CTFFFFFF,, %text%, AutoHotKeyProgressBar, Backlash BRK
WinSet, TransColor, FFFFFF 255, AutoHotKeyProgressBar
Progress, show
SetTimer, RemoveToolTip, 3000
Return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
Progress, Off
return
}
With the OSD code in your script, the following would simply display a box on your screen with the words: "Hello World" in it everytime you press Ctrl + H. ^h::OSD("Hello World")
This last bit of code is something I made to double the function of Scroll Lock as a Disable Windows Key button. Since Scroll Lock is pretty much never used, you can take advantage of the LED indicator to double as an indicator for Windows Lock. This does not remove the Scroll Lock function, so when it's active, Scroll Lock is still on.
ScrollLock::
If (GetKeyState("ScrollLock","T"))
{
SetScrollLockState, Off
;Return Windows key to full function
Hotkey Rwin, DoNothing, off
Hotkey Lwin, DoNothing, off
Hotkey Rwin Up, DoNothing, off
Hotkey Lwin Up, DoNothing, off
OSD("Windows Key Enabled")
}
Else
{
SetScrollLockState, On
; Complete Windows Key Disable
Hotkey Rwin, DoNothing, on
Hotkey LWin, DoNothing, on
;For Soft Disable Windows to allow Windows key shortcuts
;Hotkey ~Rwin Up, DoNothing, on
;Hotkey ~Lwin Up, DoNothing, on
OSD("Windows Key Disabled")
}
DoNothing:
Return
EDIT: Just in case anyone was wondering, any text following a semi-colon ";" is considered a comment/note and has no function.