From 21cfd17cdb8c6467ff8704d67a820ec17f29dbcd Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 11 Feb 2025 18:57:54 +0800 Subject: [PATCH] fix: do NOT quit when try to input `@` via `Alt Gr+Q` with German ISO keyboard layout (#970) Signed-off-by: leo --- src/Views/Launcher.axaml.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index b5f09d79..e3140191 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -120,6 +120,13 @@ namespace SourceGit.Views return; } + // Ctrl+Q quits the application (macOS use hotkeys in system menu bar) + if (!OperatingSystem.IsMacOS() && e.KeyModifiers == KeyModifiers.Control && e.Key == Key.Q) + { + App.Quit(0); + return; + } + if (e.KeyModifiers.HasFlag(OperatingSystem.IsMacOS() ? KeyModifiers.Meta : KeyModifiers.Control)) { if (e.Key == Key.W) @@ -146,13 +153,6 @@ namespace SourceGit.Views return; } - if (e.Key == Key.Q) - { - App.Quit(0); - e.Handled = true; - return; - } - if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Alt) && e.Key == Key.Right) || (!OperatingSystem.IsMacOS() && !e.KeyModifiers.HasFlag(KeyModifiers.Shift) && e.Key == Key.Tab)) {