Skip to content

Instantly share code, notes, and snippets.

@dwettstein
Last active December 22, 2022 11:28
Show Gist options
  • Save dwettstein/ec9a100b26cca0120bd3ad188e206e9a to your computer and use it in GitHub Desktop.
Save dwettstein/ec9a100b26cca0120bd3ad188e206e9a to your computer and use it in GitHub Desktop.
AutoHotkey Media Control Shortcuts
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#!Left::Send {Media_Prev} ; Win + Alt + Left
#!Down::Send {Media_Play_Pause} ; Win + Alt + Down
#!Right::Send {Media_Next} ; Win + Alt + Right
#!Up::Send {Volume_Mute} ; Win + Alt + Up
#!PgUp::Send {Volume_Up} ; Win + Alt + PageUp
#!PgDn::Send {Volume_Down} ; Win + Alt + PageDown
AppsKey & Left::Send {Media_Prev} ; Menu + Left
AppsKey & Down::Send {Media_Play_Pause} ; Menu + Down
AppsKey & Right::Send {Media_Next} ; Menu + Right
AppsKey & Up::Send {Volume_Mute} ; Menu + Up
AppsKey & PgUp::Send {Volume_Up} ; Menu + PageUp
AppsKey & PgDn::Send {Volume_Down} ; Menu + PageDown
#If MouseIsOver("ahk_class Shell_TrayWnd") ; If the mouse is over taskbar,
WheelUp::Send {Volume_Up} ; wheel over taskbar to
WheelDown::Send {Volume_Down} ; increase/decrease volume.
MouseIsOver(WinTitle) {
MouseGetPos,,, Win
return WinExist(WinTitle . " ahk_id " . Win)
}
This file has been truncated, but you can view the full file.
@dwettstein
Copy link
Author

See repository on GitHub for a newer version: https://github.com/dwettstein/MediaShortcuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment