From 3f1a0017ae7e13e8b034b4ab3f040ac67a41638d Mon Sep 17 00:00:00 2001 From: Justin Lovell Date: Wed, 11 May 2022 20:42:17 +1000 Subject: [PATCH] Intentional Input Binding for PTT The number of active bindings must be no more than two so that users do not inadvertently switch radios when a neighbouring hat switch is toggled for a brief millisecond. --- DCS-SR-Client/Network/UDPVoiceHandler.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DCS-SR-Client/Network/UDPVoiceHandler.cs b/DCS-SR-Client/Network/UDPVoiceHandler.cs index 7e13e2174..3be10d35e 100644 --- a/DCS-SR-Client/Network/UDPVoiceHandler.cs +++ b/DCS-SR-Client/Network/UDPVoiceHandler.cs @@ -159,6 +159,14 @@ public void Listen() var settings = GlobalSettingsStore.Instance; _inputManager.StartDetectPtt(pressed => { + var activeBindings = pressed.Count(state => + state.IsActive && (int) state.MainDevice.InputBind >= (int) InputBinding.Intercom && + (int) state.MainDevice.InputBind <= (int) InputBinding.Switch10); + + // By ensuring there was only one active binding during this loop, it would ensure + // the user is not surprised by any changes + if (activeBindings > 1) return; + var radios = _clientStateSingleton.DcsPlayerRadioInfo; var radioSwitchPtt = _globalSettings.ProfileSettingsStore.GetClientSettingBool(ProfileSettingsKeys.RadioSwitchIsPTT);