mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Move AlwaysOnTop to keyboard hook (like old moduleinterface)
This commit is contained in:
@@ -62,14 +62,14 @@ namespace RunnerV2.ModuleInterfaces
|
|||||||
|
|
||||||
private void InitializeHotkey()
|
private void InitializeHotkey()
|
||||||
{
|
{
|
||||||
Hotkeys.Clear();
|
Shortcuts.Clear();
|
||||||
Hotkeys.Add(((HotkeyEx)new SettingsUtils().GetSettings<AlwaysOnTopSettings>(Name).Properties.Hotkey.Value) with { Identifier = _pinHotkeyAtom }, () =>
|
Shortcuts.Add((new SettingsUtils().GetSettings<AlwaysOnTopSettings>(Name).Properties.Hotkey.Value, () =>
|
||||||
{
|
{
|
||||||
if (!_process?.HasExited ?? false)
|
if (!_process?.HasExited ?? false)
|
||||||
{
|
{
|
||||||
_pinEventWrapper?.Fire();
|
_pinEventWrapper?.Fire();
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSettingsChanged(string settingsKind, JsonElement jsonProperties)
|
public void OnSettingsChanged(string settingsKind, JsonElement jsonProperties)
|
||||||
@@ -77,7 +77,7 @@ namespace RunnerV2.ModuleInterfaces
|
|||||||
InitializeHotkey();
|
InitializeHotkey();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<HotkeyEx, Action> Hotkeys { get; } = [];
|
public List<(HotkeySettings Hotkey, Action Action)> Shortcuts { get; } = [];
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user