[FindMyMouse] Add setting to activate by shaking mouse (#16244)

* [FindMyMouse]Initial shaking activation implementation

* Add setting to change activation method

* Update Mouse Snooping on settings change

* fix spellchecker

* Place activation method setting outside the expander

* Address PR Comments
This commit is contained in:
Jaime Bernardo
2022-02-11 22:52:57 +00:00
committed by GitHub
parent f0d084c59c
commit f6a292d47f
8 changed files with 205 additions and 22 deletions

View File

@@ -8,6 +8,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{
public class FindMyMouseProperties
{
[JsonPropertyName("activation_method")]
public IntProperty ActivationMethod { get; set; }
[JsonPropertyName("do_not_activate_on_game_mode")]
public BoolProperty DoNotActivateOnGameMode { get; set; }
@@ -31,6 +34,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public FindMyMouseProperties()
{
ActivationMethod = new IntProperty(0);
DoNotActivateOnGameMode = new BoolProperty(true);
BackgroundColor = new StringProperty("#000000");
SpotlightColor = new StringProperty("#FFFFFF");

View File

@@ -47,6 +47,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
}
FindMyMouseSettingsConfig = findMyMouseSettingsRepository.SettingsConfig;
_findMyMouseActivationMethod = FindMyMouseSettingsConfig.Properties.ActivationMethod.Value;
_findMyMouseDoNotActivateOnGameMode = FindMyMouseSettingsConfig.Properties.DoNotActivateOnGameMode.Value;
string backgroundColor = FindMyMouseSettingsConfig.Properties.BackgroundColor.Value;
@@ -119,6 +120,24 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
}
}
public int FindMyMouseActivationMethod
{
get
{
return _findMyMouseActivationMethod;
}
set
{
if (value != _findMyMouseActivationMethod)
{
_findMyMouseActivationMethod = value;
FindMyMouseSettingsConfig.Properties.ActivationMethod.Value = value;
NotifyFindMyMousePropertyChanged();
}
}
}
public bool FindMyMouseDoNotActivateOnGameMode
{
get
@@ -586,6 +605,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
private Func<string, int> SendConfigMSG { get; }
private bool _isFindMyMouseEnabled;
private int _findMyMouseActivationMethod;
private bool _findMyMouseDoNotActivateOnGameMode;
private string _findMyMouseBackgroundColor;
private string _findMyMouseSpotlightColor;