Improve Ctrl+V for Windows

pull/6325/head
2dust 2024-12-22 12:02:00 +08:00
parent 9ac8aa2969
commit 6a9b62ab9a
2 changed files with 7 additions and 6 deletions

View File

@ -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<MainWindowViewModel>();
if (service != null) _ = service.AddServerViaClipboardAsync(clipboardData);
break;
case Key.S:
ScanScreenTaskAsync().ContinueWith(_ => { });
break;

View File

@ -223,12 +223,6 @@ namespace v2rayN.Views
{
switch (e.Key)
{
case Key.V:
var clipboardData = WindowsUtils.GetClipboardData();
var service = Locator.Current.GetService<MainWindowViewModel>();
if (service != null) _ = service.AddServerViaClipboardAsync(clipboardData);
break;
case Key.A:
menuSelectAll_Click(null, null);
break;