mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Converts keystrokes with alpha chars using shift
e.g. cmd-shift-l would be converted to cmd-L
This commit is contained in:
@@ -21,7 +21,14 @@ class KeyBinding
|
||||
keys = @parseKeystroke(keystroke)
|
||||
modifiers = keys[0...-1]
|
||||
modifiers.sort()
|
||||
[modifiers..., _.last(keys)].join('-')
|
||||
key = _.last(keys)
|
||||
|
||||
# Uppercase alpha chars if the shift modifer is pressed
|
||||
if 'shift' in modifiers and /^[a-z]$/i.test(key)
|
||||
modifiers = _.without(modifiers, 'shift')
|
||||
key = key.toUpperCase()
|
||||
[modifiers..., key].join('-')
|
||||
|
||||
normalizedKeystroke.join(' ')
|
||||
|
||||
@parseKeystroke: (keystroke) ->
|
||||
|
||||
Reference in New Issue
Block a user