mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[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:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user