Browse Source

Fixed key gesture matching when this has an OEM key

pull/4874/head
Yoh Deadfall 6 years ago
parent
commit
fdd9b1f31f
  1. 5
      src/Avalonia.Input/KeyGesture.cs

5
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)

Loading…
Cancel
Save