-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathShortcut.regex.txt
11 lines (11 loc) · 1.07 KB
/
Shortcut.regex.txt
1
2
3
4
5
6
7
8
9
10
11
# Matches Keyboard Shortcuts
# Keyboard Shortcuts are a <Modifiers> followed by a Key
(?<Modifiers>(?>(?<Alt>Option|Alt|LeftAltPressed|RightAltPressed|LeftAlt|RightAlt) # An <Alt> modifier
|(?<Control>Control|Ctrl|LeftCtrlPressed|LeftCtrl|RightCtrlPressd|RightCtrl) # A <Control> Modifier
|(?<Command>EnhancedKey|Command|Cmd|LeftCmd|RightCmd|Windows|Win|Apple|OpenApple) # A <Command> Modifier (the Windows or Apple key)
|(?<Shift>ShiftPressed|Shift|LeftShift|RightShift) # A <Shift> Modifier
)\+){0,3} # 0-3 modifiers are followed by a key. The Key can be
(?>(?<Key>.$) # A single-character key
|(?<VirtualKey>\{[^\}]+\}{1,2}) # A virtual key (enclosed in {}s)
|(?<KeyName>[^\,]+) # A key name
)