3

I have a Microsoft Comfort Curve keyboard (KU-0459). It features a set of buttons for volume control. The interesting one is "mute".

I also have a set of USB speakers (Logitech S-150), and a set of headphones with the usual 3.5 mm green/pink jacks going to my on-board sound card.

I am on Windows 7 Ultimate.

I am able to selectively mute the speakers by going into Control Panel -> Sounds -> Playback tab -> Right click speakers -> Disable. I'm very lazy, and I want all of this "clicking" to be done automatically whenever I press my Keyboard's mute button.

If your answer is "AutoHotkey", it would be very nice if you could supply the .ahk script itself

1 Answer 1

2

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. :)

4
  • Thank you for the script! It does work if mapped to another key, say, ^m. However, it doesn't seem to respond to Volume_Mute. Nor does the AHK recorder appear to capture it, for that matter.
    – Superbest
    Commented Feb 23, 2012 at 22:26
  • 1
    In that case, you can try to find the scan code for your Mute key. See my answer here for instructions: superuser.com/a/371141/100787 (Setup; steps 4-10)
    – iglvzx
    Commented Feb 23, 2012 at 22:28
  • 1
    Thank you! For anyone else- with the keyboard model I have, the mute key is SC120, you would use it by replacing Volume_Mute:: above with SC120::.
    – Superbest
    Commented Feb 24, 2012 at 0:15
  • Would a variant of this script use to just mute the mic? I have use cases often where I would love a quick way to make sure my mic is disabled without having to fool around with program specific ways (e.g. zoom, Webex etc.) Commented Dec 11, 2020 at 6:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .