From 25776a788e964d558e13766c692b58dc75d39208 Mon Sep 17 00:00:00 2001 From: ShiinaRinne Date: Thu, 11 May 2023 23:31:47 +0800 Subject: [PATCH] https://github.com/2dust/v2rayN/issues/3678 --- .../v2rayN/Views/GlobalHotkeySettingWindow.xaml | 15 ++++++++++----- .../Views/GlobalHotkeySettingWindow.xaml.cs | 12 ++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml index 2bf99658..9e20c6ea 100644 --- a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml +++ b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml @@ -72,7 +72,8 @@ VerticalAlignment="Top" AcceptsReturn="True" IsReadOnly="True" - Style="{StaticResource MyOutlinedTextBox}" /> + Style="{StaticResource MyOutlinedTextBox}" + PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" /> + Style="{StaticResource MyOutlinedTextBox}" + PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" /> + Style="{StaticResource MyOutlinedTextBox}" + PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" /> + Style="{StaticResource MyOutlinedTextBox}" + PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" /> + Style="{StaticResource MyOutlinedTextBox}" + PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" /> (); - txtGlobalHotkey0.KeyDown += TxtGlobalHotkey_KeyDown; - txtGlobalHotkey1.KeyDown += TxtGlobalHotkey_KeyDown; - txtGlobalHotkey2.KeyDown += TxtGlobalHotkey_KeyDown; - txtGlobalHotkey3.KeyDown += TxtGlobalHotkey_KeyDown; - txtGlobalHotkey4.KeyDown += TxtGlobalHotkey_KeyDown; + txtGlobalHotkey0.KeyDown += TxtGlobalHotkey_PreviewKeyDown; + txtGlobalHotkey1.KeyDown += TxtGlobalHotkey_PreviewKeyDown; + txtGlobalHotkey2.KeyDown += TxtGlobalHotkey_PreviewKeyDown; + txtGlobalHotkey3.KeyDown += TxtGlobalHotkey_PreviewKeyDown; + txtGlobalHotkey4.KeyDown += TxtGlobalHotkey_PreviewKeyDown; HotkeyHandler.Instance.IsPause = true; this.Closing += (s, e) => HotkeyHandler.Instance.IsPause = false; @@ -45,7 +45,7 @@ namespace v2rayN.Views BindingData(); } - private void TxtGlobalHotkey_KeyDown(object sender, KeyEventArgs e) + private void TxtGlobalHotkey_PreviewKeyDown(object sender, KeyEventArgs e) { e.Handled = true; var _ModifierKeys = new Key[] { Key.LeftCtrl, Key.RightCtrl, Key.LeftShift,