From 6a9b62ab9a06cd9b70d02687a22f320603b36bea Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 22 Dec 2024 12:02:00 +0800 Subject: [PATCH] Improve Ctrl+V for Windows --- v2rayN/v2rayN/Views/MainWindow.xaml.cs | 7 +++++++ v2rayN/v2rayN/Views/ProfilesView.xaml.cs | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index 5ad3c04a..b0292f1d 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -278,6 +278,13 @@ namespace v2rayN.Views { switch (e.Key) { + case Key.V: + if (Keyboard.FocusedElement is TextBox) return; + var clipboardData = WindowsUtils.GetClipboardData(); + var service = Locator.Current.GetService(); + if (service != null) _ = service.AddServerViaClipboardAsync(clipboardData); + break; + case Key.S: ScanScreenTaskAsync().ContinueWith(_ => { }); break; diff --git a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs index cf512349..b838cd56 100644 --- a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs +++ b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs @@ -223,12 +223,6 @@ namespace v2rayN.Views { switch (e.Key) { - case Key.V: - var clipboardData = WindowsUtils.GetClipboardData(); - var service = Locator.Current.GetService(); - if (service != null) _ = service.AddServerViaClipboardAsync(clipboardData); - break; - case Key.A: menuSelectAll_Click(null, null); break;