With the confinement because of COVID-19, I have been using Microsoft Teams for my work with my home setup that does not have a “mute” button to mute the mic of Microsoft Teams. And that’s is very annoying as Microsoft had the very odd idea to set the mute keyboard shortcut to “Ctrl+Maj+M”, which is not handy at all to operate! And it is not possible to change it.
Here is an AutoHotKey script to replace it by the hotkey Left Control + Left Alt (please note the Left Control key must be pressed before Left Alt)
LControl & LAlt::
WinGet, active_id, ID, A
WinActivate, ahk_exe Teams.exe
WinActivate, ahk_id %active_id%
SoundBeep, 200, 100
You may also download the compiled version: mute-teams.zip
This tool is great, very simple to use, even it is surprising at first: you write a script ahk with AutoHotKey syntax and execute it with one of the provided binaries. The script will remain visible in the tray bar so it can be stopped. You can also compile the script with the provided compiler, and get a standalone executable you can distribute without any annoying dependencies. And there is a ton of much more advanced features that I used to create GUIs, tray bar menu, etc.
I have struggled a while with the use of ControlSendthat should be able to send keys to a window without the need to be focused, but it worked sometimes… or not… That is why this version activates shortly the target window and revert to the one you were using. A discreet beep indicates the hotkey has been fired.
Do not miss SciTE4AutoHotKey: in addition to syntax highlighting it will provide a quite efficient debugging environment.