mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[Video Conference Mute] Push to Reverse (#24892)
* Add push to talk
* Fix multiple callback WM_KEYDOWN while holding shortcut
* Code review suggestions
* Rename feature
* Revert "Rename feature"
This reverts commit 82d64bf57c.
* Add switch and settings
* Change type of bool property. Handle settings.
* Description
* Update src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.cpp
Always consume hotkey press
Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
---------
Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
This commit is contained in:
@@ -33,6 +33,17 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
Code = 65,
|
||||
});
|
||||
|
||||
this.PushToTalkMicrophoneHotkey = new KeyboardKeysProperty(
|
||||
new HotkeySettings()
|
||||
{
|
||||
Win = true,
|
||||
Ctrl = false,
|
||||
Alt = false,
|
||||
Shift = true,
|
||||
Key = "I",
|
||||
Code = 73,
|
||||
});
|
||||
|
||||
this.MuteCameraHotkey = new KeyboardKeysProperty(
|
||||
new HotkeySettings()
|
||||
{
|
||||
@@ -43,6 +54,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
Key = "O",
|
||||
Code = 79,
|
||||
});
|
||||
|
||||
this.PushToReverseEnabled = new BoolProperty(false);
|
||||
}
|
||||
|
||||
[JsonPropertyName("mute_camera_and_microphone_hotkey")]
|
||||
@@ -51,6 +64,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
[JsonPropertyName("mute_microphone_hotkey")]
|
||||
public KeyboardKeysProperty MuteMicrophoneHotkey { get; set; }
|
||||
|
||||
[JsonPropertyName("push_to_talk_microphone_hotkey")]
|
||||
public KeyboardKeysProperty PushToTalkMicrophoneHotkey { get; set; }
|
||||
|
||||
[JsonPropertyName("push_to_reverse_enabled")]
|
||||
public BoolProperty PushToReverseEnabled { get; set; }
|
||||
|
||||
[JsonPropertyName("mute_camera_hotkey")]
|
||||
public KeyboardKeysProperty MuteCameraHotkey { get; set; }
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
<controls:ShortcutWithTextLabelControl
|
||||
x:Name="HotkeyMicControl"
|
||||
x:Uid="Oobe_VideoConference_ToggleMic" />
|
||||
<controls:ShortcutWithTextLabelControl
|
||||
x:Name="HotkeyPushToTalkControl"
|
||||
x:Uid="Oobe_VideoConference_PushToTalkMic" />
|
||||
<controls:ShortcutWithTextLabelControl
|
||||
x:Name="HotkeyVidControl"
|
||||
x:Uid="Oobe_VideoConference_ToggleVid" />
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
|
||||
ViewModel.LogOpeningModuleEvent();
|
||||
HotkeyMicVidControl.Keys = SettingsRepository<VideoConferenceSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.MuteCameraAndMicrophoneHotkey.Value.GetKeysList();
|
||||
HotkeyMicControl.Keys = SettingsRepository<VideoConferenceSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.MuteMicrophoneHotkey.Value.GetKeysList();
|
||||
HotkeyPushToTalkControl.Keys = SettingsRepository<VideoConferenceSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.PushToTalkMicrophoneHotkey.Value.GetKeysList();
|
||||
HotkeyVidControl.Keys = SettingsRepository<VideoConferenceSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.MuteCameraHotkey.Value.GetKeysList();
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,9 @@
|
||||
<data name="VideoConference_MicrophoneMuteHotkeyControl_Header.Header" xml:space="preserve">
|
||||
<value>Mute microphone</value>
|
||||
</data>
|
||||
<data name="VideoConference_MicrophonePushToTalkHotkeyControl_Header.Header" xml:space="preserve">
|
||||
<value>Push to talk</value>
|
||||
</data>
|
||||
<data name="VideoConference_CameraMuteHotkeyControl_Header.Header" xml:space="preserve">
|
||||
<value>Mute camera</value>
|
||||
</data>
|
||||
@@ -216,6 +219,12 @@
|
||||
<data name="VideoConference_SelectedMicrophone.Header" xml:space="preserve">
|
||||
<value>Selected microphone</value>
|
||||
</data>
|
||||
<data name="VideoConference_PushToReverse.Header" xml:space="preserve">
|
||||
<value>Push to reverse</value>
|
||||
</data>
|
||||
<data name="VideoConference_PushToReverse.Description" xml:space="preserve">
|
||||
<value>If enabled, allows both push to talk and push to mute, depending on microphone state</value>
|
||||
</data>
|
||||
<data name="VideoConference_CameraOverlayImagePathHeader.Header" xml:space="preserve">
|
||||
<value>Image displayed when camera is muted</value>
|
||||
</data>
|
||||
@@ -1720,6 +1729,9 @@ From there, simply click on one of the supported files in the File Explorer and
|
||||
<data name="Oobe_VideoConference_ToggleMic.Text" xml:space="preserve">
|
||||
<value>to toggle your microphone</value>
|
||||
</data>
|
||||
<data name="Oobe_VideoConference_PushToTalkMic.Text" xml:space="preserve">
|
||||
<value>to toggle your microphone until key release</value>
|
||||
</data>
|
||||
<data name="Oobe_VideoConference_ToggleVid.Text" xml:space="preserve">
|
||||
<value>to toggle your video</value>
|
||||
</data>
|
||||
|
||||
@@ -96,6 +96,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
|
||||
_cameraAndMicrophoneMuteHotkey = Settings.Properties.MuteCameraAndMicrophoneHotkey.Value;
|
||||
_microphoneMuteHotkey = Settings.Properties.MuteMicrophoneHotkey.Value;
|
||||
_microphonePushToTalkHotkey = Settings.Properties.PushToTalkMicrophoneHotkey.Value;
|
||||
_pushToReverseEnabled = Settings.Properties.PushToReverseEnabled.Value;
|
||||
_cameraMuteHotkey = Settings.Properties.MuteCameraHotkey.Value;
|
||||
CameraImageOverlayPath = Settings.Properties.CameraOverlayImagePath.Value;
|
||||
SelectOverlayImage = new ButtonClickCommand(SelectOverlayImageAction);
|
||||
@@ -176,7 +178,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
private int _toolbarHideIndex;
|
||||
private HotkeySettings _cameraAndMicrophoneMuteHotkey;
|
||||
private HotkeySettings _microphoneMuteHotkey;
|
||||
private HotkeySettings _microphonePushToTalkHotkey;
|
||||
private HotkeySettings _cameraMuteHotkey;
|
||||
private bool _pushToReverseEnabled;
|
||||
private int _selectedCameraIndex = -1;
|
||||
private int _selectedMicrophoneIndex;
|
||||
|
||||
@@ -340,6 +344,42 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public HotkeySettings MicrophonePushToTalkHotkey
|
||||
{
|
||||
get
|
||||
{
|
||||
return _microphonePushToTalkHotkey;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != _microphonePushToTalkHotkey)
|
||||
{
|
||||
_microphonePushToTalkHotkey = value;
|
||||
Settings.Properties.PushToTalkMicrophoneHotkey.Value = value;
|
||||
RaisePropertyChanged(nameof(MicrophonePushToTalkHotkey));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool PushToReverseEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return _pushToReverseEnabled;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != _pushToReverseEnabled)
|
||||
{
|
||||
_pushToReverseEnabled = value;
|
||||
Settings.Properties.PushToReverseEnabled.Value = value;
|
||||
RaisePropertyChanged(nameof(PushToReverseEnabled));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public HotkeySettings CameraMuteHotkey
|
||||
{
|
||||
get
|
||||
|
||||
@@ -77,6 +77,12 @@
|
||||
HotkeySettings="{x:Bind Path=ViewModel.MicrophoneMuteHotkey, Mode=TwoWay}" />
|
||||
</labs:SettingsCard>
|
||||
|
||||
<labs:SettingsCard x:Uid="VideoConference_MicrophonePushToTalkHotkeyControl_Header">
|
||||
<controls:ShortcutControl
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
HotkeySettings="{x:Bind Path=ViewModel.MicrophonePushToTalkHotkey, Mode=TwoWay}" />
|
||||
</labs:SettingsCard>
|
||||
|
||||
<labs:SettingsCard x:Uid="VideoConference_CameraMuteHotkeyControl_Header">
|
||||
<controls:ShortcutControl
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
@@ -95,6 +101,13 @@
|
||||
ItemsSource="{Binding MicrophoneNames, Mode=OneTime}"
|
||||
SelectedIndex="{Binding Path=SelectedMicrophoneIndex, Mode=TwoWay}" />
|
||||
</labs:SettingsCard>
|
||||
|
||||
<labs:SettingsCard
|
||||
x:Uid="VideoConference_PushToReverse">
|
||||
<ToggleSwitch
|
||||
x:Uid="PushToReverseSwitch"
|
||||
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.PushToReverseEnabled}" />
|
||||
</labs:SettingsCard>
|
||||
</controls:SettingsGroup>
|
||||
|
||||
<controls:SettingsGroup
|
||||
|
||||
Reference in New Issue
Block a user