mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-18 02:14:59 +03:00
Synchronize GlobalHotKeys library and update HotKeyManager
This commit is contained in:
+1
-1
Submodule v2rayN/GlobalHotKeys updated: 569a95bb0f...162d401dfe
@@ -8,6 +8,7 @@ public sealed class HotkeyManager
|
|||||||
private static readonly Lazy<HotkeyManager> _instance = new(() => new());
|
private static readonly Lazy<HotkeyManager> _instance = new(() => new());
|
||||||
public static HotkeyManager Instance = _instance.Value;
|
public static HotkeyManager Instance = _instance.Value;
|
||||||
private readonly Dictionary<int, EGlobalHotkey> _hotkeyTriggerDic = new();
|
private readonly Dictionary<int, EGlobalHotkey> _hotkeyTriggerDic = new();
|
||||||
|
|
||||||
[SupportedOSPlatform("windows")]
|
[SupportedOSPlatform("windows")]
|
||||||
private GlobalHotKeys.HotKeyManager? _hotKeyManager;
|
private GlobalHotKeys.HotKeyManager? _hotKeyManager;
|
||||||
|
|
||||||
@@ -74,9 +75,7 @@ public sealed class HotkeyManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_hotKeyManager?.HotKeyPressed
|
_hotKeyManager.HotKeyPressed += OnNext;
|
||||||
.ObserveOn(AvaloniaScheduler.Instance)
|
|
||||||
.Subscribe(OnNext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnNext(HotKey key)
|
private void OnNext(HotKey key)
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
|||||||
switch (e)
|
switch (e)
|
||||||
{
|
{
|
||||||
case EGlobalHotkey.ShowForm:
|
case EGlobalHotkey.ShowForm:
|
||||||
ShowHideWindow(null);
|
Dispatcher.UIThread.Post(() => ShowHideWindow(null));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EGlobalHotkey.SystemProxyClear:
|
case EGlobalHotkey.SystemProxyClear:
|
||||||
|
|||||||
Reference in New Issue
Block a user