February 26, 2021

How to Get Microsoft Teams Push To Talk Functionality

How to use Push To Talk (PTT) feature with Microsoft Teams Windows Desktop Client and the Teams Shortcuts PowerTool (based on AutoHotkey)

Screencast

Update 2021-04-12: PTT functionality was improved so that you don't need to be muted to work.
Screencast was not updated.

Status quo

As of 2021-02-26, Microsoft Teams does not offer a Push To Talk functionality.
This is a commonly discussed feature request  
Microsoft Teams Uservoice Push To Talk

A workaround based on AutoHotkey was shared (highlighted in this AddictiveTips post of February 10, 2021).
I present here an improved solution (The meeting window does have to be active and you can customize the hotkey.) implemented in the Teams Shortcuts PowerTool.

Teams Shortcuts PowerTool PTT Implementation

Assign Hotkey

In Teams Shortcuts System Tray Icon Menu, go to Settings-> Global Hotkeys->PushToTalk

You shall not use a hotkey that collides with the Microsoft Teams Mute Hotkey (Ctrl+Shift+M)
(The error will be caught if you try.)

I like to use Alt+MiddleMouseButton.

I wouldn't use the Space bar only as recommended in the AddictiveTips post because else you can not use it in the chat anymore but rather a combination e.g. Ctrl+Space. But after some tests in this case I have noticed that the prior key to release to unmute is then the Ctrl key/ not the space bar in this case. (some ahk weirdness) 

Usage

Trigger the Hotkey but keep the first key pressed.
Speak
Release the key to remute.

AutoHotkey Implementation

This is how the core code part of the functionality looks like in ahk/Lib/Teams.ahk -> Teams_PushToTalk (function)

Teams_PushToTalk(){

WinId := Teams_GetMeetingWindow() ; mute can be run from Main window

If !WinId ; empty
    return

KeyName := A_PriorKey
If (KeyName = "m") or (KeyName = "^") or (KeyName = "!") {
    MsgBox Error: hotkey conflict with native Ctrl+Shift+MChoose another combination.
    return
}

WinGet, curWinId, ID, A
WinActivate, ahk_id %WinId%
IsMuted := !(Teams_FindText("Mute"))

ToolTip  Teams PushToTalk on... 
If (IsMuted)
    SendInput ^+m ;  ctrl+shift+m

while (GetKeyState(KeyName , "P"))
{
sleep, 100
}
WinActivate, ahk_id %WinId%
SendInput ^+m ;  ctrl+shift+m
WinActivate, ahk_id %curWinId%

Tooltip("Teams PushToTalk off...",2000)  
} ; eofun

See also

Teams Shortcuts: Mute on/ off

No comments:

Post a Comment