mirror of
https://github.com/2dust/v2rayN.git
synced 2025-12-10 05:19:42 +05:00
Optimize HotkeyHandler
This commit is contained in:
@@ -24,7 +24,6 @@ namespace v2rayN.Desktop.Handler
|
|||||||
{
|
{
|
||||||
_config = config;
|
_config = config;
|
||||||
_updateFunc = updateFunc;
|
_updateFunc = updateFunc;
|
||||||
_hotKeyManager = new GlobalHotKeys.HotKeyManager();
|
|
||||||
|
|
||||||
Register();
|
Register();
|
||||||
}
|
}
|
||||||
@@ -36,6 +35,11 @@ namespace v2rayN.Desktop.Handler
|
|||||||
|
|
||||||
private void Register()
|
private void Register()
|
||||||
{
|
{
|
||||||
|
if (_config.GlobalHotkeys.Any(t => t.KeyCode > 0) == false)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_hotKeyManager ??= new GlobalHotKeys.HotKeyManager();
|
||||||
_hotkeyTriggerDic.Clear();
|
_hotkeyTriggerDic.Clear();
|
||||||
|
|
||||||
foreach (var item in _config.GlobalHotkeys)
|
foreach (var item in _config.GlobalHotkeys)
|
||||||
|
|||||||
Reference in New Issue
Block a user