[Settings] Reset Activation Key to Default Value (#26449)

* Add Default Value field to all controls

* Add reset button to Control field

* Improve button
Improve appearance
Add ToolTipService
Add AutomationProperties

* Move Reset button to Shortcut Dialog

* Fix Video Conferencing crash

* Change `Use Default` to `Reset`
This commit is contained in:
Sven
2023-06-20 15:42:04 +02:00
committed by GitHub
parent a883dcc283
commit 46ed52eab6
23 changed files with 127 additions and 78 deletions

View File

@@ -12,9 +12,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class ColorPickerProperties public class ColorPickerProperties
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x43);
public ColorPickerProperties() public ColorPickerProperties()
{ {
ActivationShortcut = new HotkeySettings(true, false, false, true, 0x43); ActivationShortcut = DefaultActivationShortcut;
ChangeCursor = false; ChangeCursor = false;
ColorHistoryLimit = 20; ColorHistoryLimit = 20;
VisibleColorFormats = new Dictionary<string, KeyValuePair<bool, string>>(); VisibleColorFormats = new Dictionary<string, KeyValuePair<bool, string>>();

View File

@@ -11,9 +11,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class ColorPickerPropertiesVersion1 public class ColorPickerPropertiesVersion1
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x43);
public ColorPickerPropertiesVersion1() public ColorPickerPropertiesVersion1()
{ {
ActivationShortcut = new HotkeySettings(true, false, false, true, 0x43); ActivationShortcut = DefaultActivationShortcut;
ChangeCursor = false; ChangeCursor = false;
ColorHistory = new List<string>(); ColorHistory = new List<string>();
ColorHistoryLimit = 20; ColorHistoryLimit = 20;

View File

@@ -10,9 +10,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class MeasureToolProperties public class MeasureToolProperties
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x4D);
public MeasureToolProperties() public MeasureToolProperties()
{ {
ActivationShortcut = new HotkeySettings(true, false, false, true, 0x4D); ActivationShortcut = DefaultActivationShortcut;
UnitsOfMeasure = new IntProperty(0); UnitsOfMeasure = new IntProperty(0);
PixelTolerance = new IntProperty(30); PixelTolerance = new IntProperty(30);
ContinuousCapture = false; ContinuousCapture = false;

View File

@@ -8,6 +8,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class MouseHighlighterProperties public class MouseHighlighterProperties
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x48);
[JsonPropertyName("activation_shortcut")] [JsonPropertyName("activation_shortcut")]
public HotkeySettings ActivationShortcut { get; set; } public HotkeySettings ActivationShortcut { get; set; }
@@ -31,7 +33,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public MouseHighlighterProperties() public MouseHighlighterProperties()
{ {
ActivationShortcut = new HotkeySettings(true, false, false, true, 0x48); ActivationShortcut = DefaultActivationShortcut;
LeftButtonClickColor = new StringProperty("#FFFF00"); LeftButtonClickColor = new StringProperty("#FFFF00");
RightButtonClickColor = new StringProperty("#0000FF"); RightButtonClickColor = new StringProperty("#0000FF");
HighlightOpacity = new IntProperty(65); HighlightOpacity = new IntProperty(65);

View File

@@ -8,6 +8,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class MouseJumpProperties public class MouseJumpProperties
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x44);
[JsonPropertyName("activation_shortcut")] [JsonPropertyName("activation_shortcut")]
public HotkeySettings ActivationShortcut { get; set; } public HotkeySettings ActivationShortcut { get; set; }
@@ -16,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public MouseJumpProperties() public MouseJumpProperties()
{ {
ActivationShortcut = new HotkeySettings(true, false, false, true, 0x44); ActivationShortcut = DefaultActivationShortcut;
ThumbnailSize = new MouseJumpThumbnailSize(); ThumbnailSize = new MouseJumpThumbnailSize();
} }
} }

View File

@@ -8,6 +8,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class MousePointerCrosshairsProperties public class MousePointerCrosshairsProperties
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, true, false, 0x50); // Win + Alt + P
[JsonPropertyName("activation_shortcut")] [JsonPropertyName("activation_shortcut")]
public HotkeySettings ActivationShortcut { get; set; } public HotkeySettings ActivationShortcut { get; set; }
@@ -31,7 +33,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public MousePointerCrosshairsProperties() public MousePointerCrosshairsProperties()
{ {
ActivationShortcut = new HotkeySettings(true, false, true, false, 0x50); // Win + Alt + P ActivationShortcut = DefaultActivationShortcut;
CrosshairsColor = new StringProperty("#FF0000"); CrosshairsColor = new StringProperty("#FF0000");
CrosshairsOpacity = new IntProperty(75); CrosshairsOpacity = new IntProperty(75);
CrosshairsRadius = new IntProperty(20); CrosshairsRadius = new IntProperty(20);

View File

@@ -8,9 +8,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class PastePlainProperties public class PastePlainProperties
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, true, true, false, 0x56); // Ctrl+Win+Alt+V
public PastePlainProperties() public PastePlainProperties()
{ {
ActivationShortcut = new HotkeySettings(true, true, true, false, 0x56); // Ctrl+Win+Alt+V ActivationShortcut = DefaultActivationShortcut;
} }
public HotkeySettings ActivationShortcut { get; set; } public HotkeySettings ActivationShortcut { get; set; }

View File

@@ -8,9 +8,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class PeekProperties public class PeekProperties
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(false, true, false, false, 0x20);
public PeekProperties() public PeekProperties()
{ {
ActivationShortcut = new HotkeySettings(false, true, false, false, 0x20); ActivationShortcut = DefaultActivationShortcut;
AlwaysRunNotElevated = new BoolProperty(true); AlwaysRunNotElevated = new BoolProperty(true);
CloseAfterLosingFocus = new BoolProperty(false); CloseAfterLosingFocus = new BoolProperty(false);
} }

View File

@@ -75,11 +75,17 @@ namespace Microsoft.PowerToys.Settings.UI.Library
[JsonPropertyName("generate_thumbnails_from_files")] [JsonPropertyName("generate_thumbnails_from_files")]
public bool GenerateThumbnailsFromFiles { get; set; } public bool GenerateThumbnailsFromFiles { get; set; }
public HotkeySettings DefaultOpenPowerLauncher => new HotkeySettings(false, false, true, false, 32);
public HotkeySettings DefaultOpenFileLocation => new HotkeySettings();
public HotkeySettings DefaultCopyPathLocation => new HotkeySettings();
public PowerLauncherProperties() public PowerLauncherProperties()
{ {
OpenPowerLauncher = new HotkeySettings(false, false, true, false, 32); OpenPowerLauncher = DefaultOpenPowerLauncher;
OpenFileLocation = new HotkeySettings(); OpenFileLocation = DefaultOpenFileLocation;
CopyPathLocation = new HotkeySettings(); CopyPathLocation = DefaultCopyPathLocation;
OpenConsole = new HotkeySettings(); OpenConsole = new HotkeySettings();
SearchResultPreference = "most_recently_used"; SearchResultPreference = "most_recently_used";
SearchTypePreference = "application_name"; SearchTypePreference = "application_name";

View File

@@ -8,9 +8,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class PowerOcrProperties public class PowerOcrProperties
{ {
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x54); // Win+Shift+T
public PowerOcrProperties() public PowerOcrProperties()
{ {
ActivationShortcut = new HotkeySettings(true, false, false, true, 0x54); // Win+Shift+T ActivationShortcut = DefaultActivationShortcut;
PreferredLanguage = string.Empty; PreferredLanguage = string.Empty;
} }

View File

@@ -8,6 +8,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class ShortcutGuideProperties public class ShortcutGuideProperties
{ {
public HotkeySettings DefaultOpenShortcutGuide => new HotkeySettings(true, false, false, true, 0xBF);
public ShortcutGuideProperties() public ShortcutGuideProperties()
{ {
OverlayOpacity = new IntProperty(90); OverlayOpacity = new IntProperty(90);
@@ -16,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
PressTimeForTaskbarIconShortcuts = new IntProperty(900); PressTimeForTaskbarIconShortcuts = new IntProperty(900);
Theme = new StringProperty("system"); Theme = new StringProperty("system");
DisabledApps = new StringProperty(); DisabledApps = new StringProperty();
OpenShortcutGuide = new HotkeySettings(true, false, false, true, 0xBF); OpenShortcutGuide = DefaultOpenShortcutGuide;
} }
[JsonPropertyName("open_shortcutguide")] [JsonPropertyName("open_shortcutguide")]

View File

@@ -9,10 +9,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
public class VideoConferenceConfigProperties public class VideoConferenceConfigProperties
{ {
public VideoConferenceConfigProperties() public HotkeySettings DefaultMuteCameraAndMicrophoneHotkey => new HotkeySettings()
{
this.MuteCameraAndMicrophoneHotkey = new KeyboardKeysProperty(
new HotkeySettings()
{ {
Win = true, Win = true,
Ctrl = false, Ctrl = false,
@@ -20,10 +17,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library
Shift = true, Shift = true,
Key = "Q", Key = "Q",
Code = 81, Code = 81,
}); };
this.MuteMicrophoneHotkey = new KeyboardKeysProperty( public HotkeySettings DefaultMuteMicrophoneHotkey => new HotkeySettings()
new HotkeySettings()
{ {
Win = true, Win = true,
Ctrl = false, Ctrl = false,
@@ -31,10 +27,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library
Shift = true, Shift = true,
Key = "A", Key = "A",
Code = 65, Code = 65,
}); };
this.PushToTalkMicrophoneHotkey = new KeyboardKeysProperty( public HotkeySettings DefaultPushToTalkMicrophoneHotkey => new HotkeySettings()
new HotkeySettings()
{ {
Win = true, Win = true,
Ctrl = false, Ctrl = false,
@@ -42,10 +37,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library
Shift = true, Shift = true,
Key = "I", Key = "I",
Code = 73, Code = 73,
}); };
this.MuteCameraHotkey = new KeyboardKeysProperty( public HotkeySettings DefaultMuteCameraHotkey => new HotkeySettings()
new HotkeySettings()
{ {
Win = true, Win = true,
Ctrl = false, Ctrl = false,
@@ -53,9 +47,16 @@ namespace Microsoft.PowerToys.Settings.UI.Library
Shift = true, Shift = true,
Key = "O", Key = "O",
Code = 79, Code = 79,
}); };
this.PushToReverseEnabled = new BoolProperty(false); public VideoConferenceConfigProperties()
{
MuteCameraAndMicrophoneHotkey = new KeyboardKeysProperty(DefaultMuteCameraAndMicrophoneHotkey);
MuteMicrophoneHotkey = new KeyboardKeysProperty(DefaultMuteMicrophoneHotkey);
PushToTalkMicrophoneHotkey = new KeyboardKeysProperty(DefaultPushToTalkMicrophoneHotkey);
MuteCameraHotkey = new KeyboardKeysProperty(DefaultMuteCameraHotkey);
PushToReverseEnabled = new BoolProperty(false);
} }
[JsonPropertyName("mute_camera_and_microphone_hotkey")] [JsonPropertyName("mute_camera_and_microphone_hotkey")]

View File

@@ -101,10 +101,12 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
Title = resourceLoader.GetString("Activation_Shortcut_Title"), Title = resourceLoader.GetString("Activation_Shortcut_Title"),
Content = c, Content = c,
PrimaryButtonText = resourceLoader.GetString("Activation_Shortcut_Save"), PrimaryButtonText = resourceLoader.GetString("Activation_Shortcut_Save"),
SecondaryButtonText = resourceLoader.GetString("Activation_Shortcut_Reset"),
CloseButtonText = resourceLoader.GetString("Activation_Shortcut_Cancel"), CloseButtonText = resourceLoader.GetString("Activation_Shortcut_Cancel"),
DefaultButton = ContentDialogButton.Primary, DefaultButton = ContentDialogButton.Primary,
}; };
shortcutDialog.PrimaryButtonClick += ShortcutDialog_PrimaryButtonClick; shortcutDialog.PrimaryButtonClick += ShortcutDialog_PrimaryButtonClick;
shortcutDialog.SecondaryButtonClick += ShortcutDialog_Reset;
shortcutDialog.Opened += ShortcutDialog_Opened; shortcutDialog.Opened += ShortcutDialog_Opened;
shortcutDialog.Closing += ShortcutDialog_Closing; shortcutDialog.Closing += ShortcutDialog_Closing;
AutomationProperties.SetName(EditButton, resourceLoader.GetString("Activation_Shortcut_Title")); AutomationProperties.SetName(EditButton, resourceLoader.GetString("Activation_Shortcut_Title"));
@@ -355,6 +357,19 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
await shortcutDialog.ShowAsync(); await shortcutDialog.ShowAsync();
} }
private void ShortcutDialog_Reset(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
hotkeySettings = null;
SetValue(HotkeySettingsProperty, hotkeySettings);
PreviewKeysControl.ItemsSource = HotkeySettings.GetKeysList();
lastValidSettings = hotkeySettings;
AutomationProperties.SetHelpText(EditButton, HotkeySettings.ToString());
shortcutDialog.Hide();
}
private void ShortcutDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) private void ShortcutDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{ {
if (ComboIsValid(lastValidSettings)) if (ComboIsValid(lastValidSettings))

View File

@@ -2471,6 +2471,9 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="Activation_Shortcut_Description.Text" xml:space="preserve"> <data name="Activation_Shortcut_Description.Text" xml:space="preserve">
<value>Press a combination of keys to change this shortcut</value> <value>Press a combination of keys to change this shortcut</value>
</data> </data>
<data name="Activation_Shortcut_Reset" xml:space="preserve">
<value>Reset</value>
</data>
<data name="Activation_Shortcut_Save" xml:space="preserve"> <data name="Activation_Shortcut_Save" xml:space="preserve">
<value>Save</value> <value>Save</value>
</data> </data>

View File

@@ -148,7 +148,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (_colorPickerSettings.Properties.ActivationShortcut != value) if (_colorPickerSettings.Properties.ActivationShortcut != value)
{ {
_colorPickerSettings.Properties.ActivationShortcut = value; _colorPickerSettings.Properties.ActivationShortcut = value ?? _colorPickerSettings.Properties.DefaultActivationShortcut;
OnPropertyChanged(nameof(ActivationShortcut)); OnPropertyChanged(nameof(ActivationShortcut));
NotifySettingsChanged(); NotifySettingsChanged();
} }

View File

@@ -209,7 +209,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (Settings.Properties.ActivationShortcut != value) if (Settings.Properties.ActivationShortcut != value)
{ {
Settings.Properties.ActivationShortcut = value; Settings.Properties.ActivationShortcut = value ?? Settings.Properties.DefaultActivationShortcut;
NotifyPropertyChanged(); NotifyPropertyChanged();

View File

@@ -427,7 +427,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (MouseHighlighterSettingsConfig.Properties.ActivationShortcut != value) if (MouseHighlighterSettingsConfig.Properties.ActivationShortcut != value)
{ {
MouseHighlighterSettingsConfig.Properties.ActivationShortcut = value; MouseHighlighterSettingsConfig.Properties.ActivationShortcut = value ?? MouseHighlighterSettingsConfig.Properties.DefaultActivationShortcut;
NotifyMouseHighlighterPropertyChanged(); NotifyMouseHighlighterPropertyChanged();
} }
} }
@@ -595,7 +595,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (MouseJumpSettingsConfig.Properties.ActivationShortcut != value) if (MouseJumpSettingsConfig.Properties.ActivationShortcut != value)
{ {
MouseJumpSettingsConfig.Properties.ActivationShortcut = value; MouseJumpSettingsConfig.Properties.ActivationShortcut = value ?? MouseJumpSettingsConfig.Properties.DefaultActivationShortcut;
NotifyMouseJumpPropertyChanged(); NotifyMouseJumpPropertyChanged();
} }
} }
@@ -676,7 +676,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (MousePointerCrosshairsSettingsConfig.Properties.ActivationShortcut != value) if (MousePointerCrosshairsSettingsConfig.Properties.ActivationShortcut != value)
{ {
MousePointerCrosshairsSettingsConfig.Properties.ActivationShortcut = value; MousePointerCrosshairsSettingsConfig.Properties.ActivationShortcut = value ?? MousePointerCrosshairsSettingsConfig.Properties.DefaultActivationShortcut;
NotifyMousePointerCrosshairsPropertyChanged(); NotifyMousePointerCrosshairsPropertyChanged();
} }
} }

View File

@@ -126,7 +126,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (_pastePlainSettings.Properties.ActivationShortcut != value) if (_pastePlainSettings.Properties.ActivationShortcut != value)
{ {
_pastePlainSettings.Properties.ActivationShortcut = value; _pastePlainSettings.Properties.ActivationShortcut = value ?? _pastePlainSettings.Properties.DefaultActivationShortcut;
OnPropertyChanged(nameof(ActivationShortcut)); OnPropertyChanged(nameof(ActivationShortcut));
OnPropertyChanged(nameof(IsConflictingCopyShortcut)); OnPropertyChanged(nameof(IsConflictingCopyShortcut));

View File

@@ -102,7 +102,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (_peekSettings.Properties.ActivationShortcut != value) if (_peekSettings.Properties.ActivationShortcut != value)
{ {
_peekSettings.Properties.ActivationShortcut = value; _peekSettings.Properties.ActivationShortcut = value ?? _peekSettings.Properties.DefaultActivationShortcut;
OnPropertyChanged(nameof(ActivationShortcut)); OnPropertyChanged(nameof(ActivationShortcut));
NotifySettingsChanged(); NotifySettingsChanged();
} }

View File

@@ -319,7 +319,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (settings.Properties.OpenPowerLauncher != value) if (settings.Properties.OpenPowerLauncher != value)
{ {
settings.Properties.OpenPowerLauncher = value; settings.Properties.OpenPowerLauncher = value ?? settings.Properties.DefaultOpenPowerLauncher;
UpdateSettings(); UpdateSettings();
} }
} }
@@ -455,7 +455,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (settings.Properties.OpenFileLocation != value) if (settings.Properties.OpenFileLocation != value)
{ {
settings.Properties.OpenFileLocation = value; settings.Properties.OpenFileLocation = value ?? settings.Properties.DefaultOpenFileLocation;
UpdateSettings(); UpdateSettings();
} }
} }
@@ -472,7 +472,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (settings.Properties.CopyPathLocation != value) if (settings.Properties.CopyPathLocation != value)
{ {
settings.Properties.CopyPathLocation = value; settings.Properties.CopyPathLocation = value ?? settings.Properties.DefaultCopyPathLocation;
UpdateSettings(); UpdateSettings();
} }
} }

View File

@@ -158,7 +158,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (_powerOcrSettings.Properties.ActivationShortcut != value) if (_powerOcrSettings.Properties.ActivationShortcut != value)
{ {
_powerOcrSettings.Properties.ActivationShortcut = value; _powerOcrSettings.Properties.ActivationShortcut = value ?? _powerOcrSettings.Properties.DefaultActivationShortcut;
OnPropertyChanged(nameof(ActivationShortcut)); OnPropertyChanged(nameof(ActivationShortcut));
_settingsUtils.SaveSettings(_powerOcrSettings.ToJsonString(), PowerOcrSettings.ModuleName); _settingsUtils.SaveSettings(_powerOcrSettings.ToJsonString(), PowerOcrSettings.ModuleName);

View File

@@ -138,7 +138,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (Settings.Properties.OpenShortcutGuide != value) if (Settings.Properties.OpenShortcutGuide != value)
{ {
Settings.Properties.OpenShortcutGuide = value; Settings.Properties.OpenShortcutGuide = value ?? Settings.Properties.DefaultOpenShortcutGuide;
NotifyPropertyChanged(); NotifyPropertyChanged();
} }
} }

View File

@@ -319,8 +319,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (value != _cameraAndMicrophoneMuteHotkey) if (value != _cameraAndMicrophoneMuteHotkey)
{ {
_cameraAndMicrophoneMuteHotkey = value; var hotkey = value ?? Settings.Properties.DefaultMuteCameraAndMicrophoneHotkey;
Settings.Properties.MuteCameraAndMicrophoneHotkey.Value = value; _cameraAndMicrophoneMuteHotkey = hotkey;
Settings.Properties.MuteCameraAndMicrophoneHotkey.Value = hotkey;
RaisePropertyChanged(nameof(CameraAndMicrophoneMuteHotkey)); RaisePropertyChanged(nameof(CameraAndMicrophoneMuteHotkey));
} }
} }
@@ -337,8 +338,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (value != _microphoneMuteHotkey) if (value != _microphoneMuteHotkey)
{ {
_microphoneMuteHotkey = value; var hotkey = value ?? Settings.Properties.DefaultMuteMicrophoneHotkey;
Settings.Properties.MuteMicrophoneHotkey.Value = value; _microphoneMuteHotkey = hotkey;
Settings.Properties.MuteMicrophoneHotkey.Value = hotkey;
RaisePropertyChanged(nameof(MicrophoneMuteHotkey)); RaisePropertyChanged(nameof(MicrophoneMuteHotkey));
} }
} }
@@ -355,8 +357,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (value != _microphonePushToTalkHotkey) if (value != _microphonePushToTalkHotkey)
{ {
_microphonePushToTalkHotkey = value; var hotkey = value ?? Settings.Properties.DefaultMuteMicrophoneHotkey;
Settings.Properties.PushToTalkMicrophoneHotkey.Value = value; _microphonePushToTalkHotkey = hotkey;
Settings.Properties.PushToTalkMicrophoneHotkey.Value = hotkey;
RaisePropertyChanged(nameof(MicrophonePushToTalkHotkey)); RaisePropertyChanged(nameof(MicrophonePushToTalkHotkey));
} }
} }
@@ -391,8 +394,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
if (value != _cameraMuteHotkey) if (value != _cameraMuteHotkey)
{ {
_cameraMuteHotkey = value; var hotkey = value ?? Settings.Properties.DefaultMuteCameraHotkey;
Settings.Properties.MuteCameraHotkey.Value = value; _cameraMuteHotkey = hotkey;
Settings.Properties.MuteCameraHotkey.Value = hotkey;
RaisePropertyChanged(nameof(CameraMuteHotkey)); RaisePropertyChanged(nameof(CameraMuteHotkey));
} }
} }