A memo on how to mute Windows audio with a keyboard shortcut using AutoHotKey language programs.
I want to avoid music playing through open headphones while sleeping. It would be convenient to quickly toggle mute with a keyboard shortcut before going to bed.
So here’s the script.
^NumpadIns::Volume_Mute
Press Ctrl while pressing the numpad 0 key to toggle mute.
Don’t forget to turn off numlock.
If you want to keep numlock on, here’s the script.
^Numpad0::Volume_Mute
Explanation
There’s a predefined Volume_Mute key that toggles mute, and I’m assigning this to a key.
Reference https://autohotkey.com/docs/KeyList.htm