Skip to content

Commit 7030a2e

Browse files
committed
Don't allow “shift” key without other modifiers or function key
Fixes #54
1 parent 52b5666 commit 7030a2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/KeyboardShortcuts/RecorderCocoa.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,9 @@ extension KeyboardShortcuts {
207207
return nil
208208
}
209209

210+
// The “shift” key is not allowed without other modifiers or a function key, since it doesn't actually work.
210211
guard
211-
!event.modifiers.isEmpty
212+
!event.modifiers.subtracting(.shift).isEmpty
212213
|| event.specialKey?.isFunctionKey == true,
213214
let shortcut = Shortcut(event: event)
214215
else {

0 commit comments

Comments
 (0)