How to use the keyboard's mute button to mute only the speakers, not the headphones?

Solution 1:

I have written many AutoHotkey scripts to navigate the Control Panel, so I've got you covered! The following script requires that Show Disabled Devices is on

show disabled devices

and that Speakers is Enabled when starting the script.

Note: in my case, Speakers was the 2nd item in the list, so I set the variable speakers to 2.

speakers


enabled = 0
speakers = 2

Volume_Mute::
{
    enabled := !enabled

    Run, control /name Microsoft.Sound
    WinWaitActive, Sound

    Send, {Down %speakers%} ;Speakers
    Send, +{F10} ;Right click

    if (enabled = 1)
    {
        Send, d ;Disable
    }
    else
    {
        Send, e ;Enable
    }

    WinClose, Sound

    return
}

If you are unfamiliar with AutoHotkey or would like a precompiled version of the script, I can provide one that takes the speaker variabled as a parameter. Just let me know. :)