From 69178838be109ee7dcacb014789d32e2d510220a Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 12 Aug 2024 16:51:37 +0800 Subject: [PATCH] fix: always trait `Atl/Ctrl/Shift` as key modifers (#351) --- src/Views/Launcher.axaml.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index 95fbee7e..e73ad1a9 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -153,9 +153,19 @@ namespace SourceGit.Views base.OnKeyDown(e); + // Record unhandled key modifers. if (!e.Handled) { _unhandledModifiers = e.KeyModifiers; + + if (!_unhandledModifiers.HasFlag(KeyModifiers.Alt) && (e.Key == Key.LeftAlt || e.Key == Key.RightAlt)) + _unhandledModifiers |= KeyModifiers.Alt; + + if (!_unhandledModifiers.HasFlag(KeyModifiers.Control) && (e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl)) + _unhandledModifiers |= KeyModifiers.Control; + + if (!_unhandledModifiers.HasFlag(KeyModifiers.Shift) && (e.Key == Key.LeftShift || e.Key == Key.RightShift)) + _unhandledModifiers |= KeyModifiers.Shift; } }