Browse Source

Merge pull request #4874 from YohDeadfall/key-gesture-matching

Fixed key gesture matching when this has an OEM key
pull/4884/head
Jumar Macato 5 years ago
committed by GitHub
parent
commit
c75b8cef85
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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