Skip to content

Commit

Permalink
Fixed issue where a click with no modifiers was accepted, even though…
Browse files Browse the repository at this point in the history
… a modifier was expected. (#50)
  • Loading branch information
Snowcrash5 authored Mar 7, 2024
1 parent f189254 commit 6e892f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/hotkey_manager/lib/src/hotkey_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ class HotKeyManager {
final physicalKeysPressed = HardwareKeyboard.instance.physicalKeysPressed;
HotKey? hotKey = _hotKeyList.firstWhereOrNull(
(e) {
List<HotKeyModifier>? modifiers = HotKeyModifier.values
List<HotKeyModifier> modifiers = HotKeyModifier.values
.where((e) => e.physicalKeys.any(physicalKeysPressed.contains))
.toList();
return e.scope == HotKeyScope.inapp &&
keyEvent.logicalKey == e.logicalKey &&
modifiers.length == (e.modifiers?.length ?? 0) &&
modifiers.every((e.modifiers ?? []).contains);
},
);
Expand Down

0 comments on commit 6e892f1

Please sign in to comment.