@@ -36,6 +36,8 @@ interface Shortcut {
3636
3737const chainedShortcutRegex = / ^ [ ^ - ] + .* - .* [ ^ - ] + $ /
3838const combinedShortcutRegex = / ^ [ ^ _ ] + .* _ .* [ ^ _ ] + $ /
39+ // keyboard keys which can be combined with Shift modifier (in addition to alphabet keys)
40+ const shiftableKeys = [ 'arrowleft' , 'arrowright' , 'arrowup' , 'arrowright' , 'tab' , 'escape' , 'enter' , 'backspace' ]
3941
4042export function extractShortcuts ( items : any [ ] | any [ ] [ ] ) {
4143 const shortcuts : Record < string , Handler > = { }
@@ -76,7 +78,8 @@ export function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: Shor
7678 return
7779 }
7880
79- const alphabeticalKey = / ^ [ a - z ] { 1 } $ / i. test ( e . key )
81+ const alphabetKey = / ^ [ a - z ] { 1 } $ / i. test ( e . key )
82+ const shiftableKey = shiftableKeys . includes ( e . key . toLowerCase ( ) )
8083
8184 let chainedKey
8285 chainedInputs . value . push ( e . key )
@@ -109,9 +112,9 @@ export function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: Shor
109112 if ( e . ctrlKey !== shortcut . ctrlKey ) {
110113 continue
111114 }
112- // shift modifier is only checked in combination with alphabetical keys
113- // (shift with non-alphabetical keys would change the key)
114- if ( alphabeticalKey && e . shiftKey !== shortcut . shiftKey ) {
115+ // shift modifier is only checked in combination with alphabet keys and some extra keys
116+ // (shift with special characters would change the key)
117+ if ( ( alphabetKey || shiftableKey ) && e . shiftKey !== shortcut . shiftKey ) {
115118 continue
116119 }
117120 // alt modifier changes the combined key anyways
0 commit comments