From 3287603d0ae4caf56a806782f379697aa6e29262 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sat, 20 Dec 2025 18:04:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=BF=AB=E6=8D=B7=E9=94=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Helpers/GlobalHotkeyManager.cs | 17 +++++++++++++++++ Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs | 1 + 2 files changed, 18 insertions(+) diff --git a/Ink Canvas/Helpers/GlobalHotkeyManager.cs b/Ink Canvas/Helpers/GlobalHotkeyManager.cs index cd974d6e..d36b4aaf 100644 --- a/Ink Canvas/Helpers/GlobalHotkeyManager.cs +++ b/Ink Canvas/Helpers/GlobalHotkeyManager.cs @@ -392,6 +392,13 @@ namespace Ink_Canvas.Helpers } else { + if (_registeredHotkeys.Count == 0) + { + if (ShouldEnableHotkeysBasedOnContext()) + { + LoadHotkeysFromSettings(); + } + } } } catch (Exception ex) @@ -447,6 +454,11 @@ namespace Ink_Canvas.Helpers { // 如果设置允许,则在鼠标模式下也启用快捷键 EnableHotkeyRegistration(); + + if (_hotkeysShouldBeRegistered && _registeredHotkeys.Count == 0) + { + LoadHotkeysFromSettings(); + } } else { @@ -458,6 +470,11 @@ namespace Ink_Canvas.Helpers { // 非鼠标模式下启用快捷键 EnableHotkeyRegistration(); + + if (_hotkeysShouldBeRegistered && _registeredHotkeys.Count == 0) + { + LoadHotkeysFromSettings(); + } } } catch (Exception ex) diff --git a/Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs b/Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs index 8172acbf..715f746c 100644 --- a/Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs +++ b/Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Windows; using System.Windows.Controls; using System.Windows.Input; +using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox; namespace Ink_Canvas.Windows {