Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
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 Feb 23 '12 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 Feb 23 '12 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 Feb 24 '12 at 0:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.