Forráskód Böngészése

Fixed key gesture matching when this has an OEM key

Yoh Deadfall 5 éve
szülő
commit
fdd9b1f31f
1 módosított fájl, 4 hozzáadás és 1 törlés
  1. 4 1
      src/Avalonia.Input/KeyGesture.cs

+ 4 - 1
src/Avalonia.Input/KeyGesture.cs

@@ -144,7 +144,10 @@ namespace Avalonia.Input
             return s.ToString();
         }
 
-        public bool Matches(KeyEventArgs keyEvent) => ResolveNumPadOperationKey(keyEvent.Key) == Key && keyEvent.KeyModifiers == KeyModifiers;
+        public bool Matches(KeyEventArgs keyEvent) =>
+            keyEvent != null &&
+            keyEvent.KeyModifiers == KeyModifiers &&
+            ResolveNumPadOperationKey(keyEvent.Key) == ResolveNumPadOperationKey(Key);
 
         // TODO: Move that to external key parser
         private static Key ParseKey(string key)