[FindMyMouse]Support different activation modes (#28096)

* multiple activation modes for find my mouse

* use custom shortcut
This commit is contained in:
Davide Giacometti
2023-09-04 17:58:37 +02:00
committed by GitHub
parent 752c298ef3
commit 83f0625427
13 changed files with 222 additions and 36 deletions

View File

@@ -8,9 +8,14 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{
public class FindMyMouseProperties
{
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x46);
[JsonPropertyName("activation_method")]
public IntProperty ActivationMethod { get; set; }
[JsonPropertyName("activation_shortcut")]
public HotkeySettings ActivationShortcut { get; set; }
[JsonPropertyName("do_not_activate_on_game_mode")]
public BoolProperty DoNotActivateOnGameMode { get; set; }
@@ -41,6 +46,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public FindMyMouseProperties()
{
ActivationMethod = new IntProperty(0);
ActivationShortcut = DefaultActivationShortcut;
DoNotActivateOnGameMode = new BoolProperty(true);
BackgroundColor = new StringProperty("#000000");
SpotlightColor = new StringProperty("#FFFFFF");

View File

@@ -18,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{
Name = ModuleName;
Properties = new FindMyMouseProperties();
Version = "1.0";
Version = "1.1";
}
public string GetModuleName()
@@ -29,6 +29,17 @@ namespace Microsoft.PowerToys.Settings.UI.Library
// This can be utilized in the future if the settings.json file is to be modified/deleted.
public bool UpgradeSettingsConfiguration()
{
if (Version == "1.0")
{
if (Properties.ActivationMethod.Value == 1)
{
Properties.ActivationMethod = new IntProperty(2);
}
Version = "1.1";
return true;
}
return false;
}
}