From a0f956c885eb13312eecc8e888b0ed2023ccfb5a Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:02:09 +0800 Subject: [PATCH] Add command shortcut keys for macos https://github.com/2dust/v2rayN/issues/6375 --- v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs | 2 +- v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs | 2 +- v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs | 2 +- v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 279b6063..0d1566e9 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -304,7 +304,7 @@ namespace v2rayN.Desktop.Views private async void MainWindow_KeyDown(object? sender, KeyEventArgs e) { - if (e.KeyModifiers == KeyModifiers.Control) + if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta) { switch (e.Key) { diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs index fb5cba07..4ddfa2c2 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs @@ -233,7 +233,7 @@ namespace v2rayN.Desktop.Views private void LstProfiles_KeyDown(object? sender, KeyEventArgs e) { - if (e.KeyModifiers == KeyModifiers.Control) + if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta) { switch (e.Key) { diff --git a/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs index db233fc1..5be3c793 100644 --- a/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs @@ -128,7 +128,7 @@ namespace v2rayN.Desktop.Views private void RoutingRuleSettingWindow_KeyDown(object? sender, KeyEventArgs e) { - if (e.KeyModifiers == KeyModifiers.Control) + if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta) { if (e.Key == Key.A) { diff --git a/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs index ed54a823..de74c39e 100644 --- a/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs @@ -83,7 +83,7 @@ namespace v2rayN.Desktop.Views private void RoutingSettingWindow_KeyDown(object? sender, KeyEventArgs e) { - if (e.KeyModifiers == KeyModifiers.Control) + if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta) { if (e.Key == Key.A) {