[MWB]Migrate to PowerToys-style shortcuts and better defaults(#27442)

* [MWB] Migrate to PowerToys-style shortcuts and disable Ctrlx3 for multiple mode

* f: analyzer fixes

* f: add Win to all default shortcuts

* f: remove capture screen feature

* f: add ability to disable shortcut

* f: restrict disabling shortcuts only for MWB for now, because we don't explicitly support this feature anywhere else

* handle downgrade->upgrade scenario

* f: res loader

* f: fix disabled state

* f: fix L hotkey handling
This commit is contained in:
Andrey Nekrasov
2023-07-26 13:46:41 +02:00
committed by GitHub
parent 61aa0a1f79
commit a99b2e0bc0
13 changed files with 354 additions and 415 deletions

View File

@@ -23,6 +23,14 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public class MouseWithoutBordersProperties : ICloneable
{
public static HotkeySettings DefaultHotKeySwitch2AllPC => new HotkeySettings();
public static HotkeySettings DefaultHotKeyLockMachine => new HotkeySettings(true, true, true, false, 0x4C);
public static HotkeySettings DefaultHotKeyReconnect => new HotkeySettings(true, true, true, false, 0x52);
public static HotkeySettings DefaultHotKeyToggleEasyMouse => new HotkeySettings(true, true, true, false, 0x45);
public StringProperty SecurityKey { get; set; }
[JsonConverter(typeof(BoolPropertyJsonConverter))]
@@ -86,14 +94,30 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public IntProperty HotKeySwitchMachine { get; set; }
[ObsoleteAttribute("Use ToggleEasyMouseShortcut instead", false)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IntProperty HotKeyToggleEasyMouse { get; set; }
[ObsoleteAttribute("Use LockMachineShortcut instead", false)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IntProperty HotKeyLockMachine { get; set; }
[ObsoleteAttribute("Use ReconnectShortcut instead", false)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IntProperty HotKeyReconnect { get; set; }
[ObsoleteAttribute("Use Switch2AllPCShortcut instead", false)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IntProperty HotKeySwitch2AllPC { get; set; }
public HotkeySettings ToggleEasyMouseShortcut { get; set; }
public HotkeySettings LockMachineShortcut { get; set; }
public HotkeySettings ReconnectShortcut { get; set; }
public HotkeySettings Switch2AllPCShortcut { get; set; }
public IntProperty TCPPort { get; set; }
[JsonConverter(typeof(BoolPropertyJsonConverter))]
@@ -127,10 +151,10 @@ namespace Microsoft.PowerToys.Settings.UI.Library
UseService = false;
HotKeySwitchMachine = new IntProperty(0x70); // VK.F1
HotKeyToggleEasyMouse = new IntProperty(0x45); // VK.E
HotKeyLockMachine = new IntProperty(0x4C); // VK.L
HotKeyReconnect = new IntProperty(0x52); // VK.R
HotKeySwitch2AllPC = new IntProperty(0); // Disabled
ToggleEasyMouseShortcut = DefaultHotKeyToggleEasyMouse;
LockMachineShortcut = DefaultHotKeyLockMachine;
ReconnectShortcut = DefaultHotKeyReconnect;
Switch2AllPCShortcut = DefaultHotKeySwitch2AllPC;
// These are internal, i.e. cannot be edited directly from UI
MachinePool = ":,:,:,:";