fix: always trait Atl/Ctrl/Shift as key modifers (#351)

This commit is contained in:
leo 2024-08-12 16:51:37 +08:00
parent 0646db36a4
commit 69178838be
No known key found for this signature in database

View file

@ -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;
}
}