   cancelable = true
   view = null
 
-  key = key.toUpperCase() if /^[a-z]$/.test(key)
+  key = key.toUpperCase() if LowerCaseLetterRegex.test(key)
   if key.length is 1
     keyIdentifier = "U+#{key.charCodeAt(0).toString(16)}"
   else

      keystroke += '-' if keystroke
      keystroke += 'shift'
    # Only upper case alphabetic characters like 'a'
    key = key.toUpperCase() if /^[a-z]$/.test(key)
  else
    key = key.toLowerCase() if /^[A-Z]$/.test(key)
  if event.metaKey
    keystroke += '-' if keystroke
    keystroke += 'cmd'


AtomModifierRegex = /(ctrl|alt|shift|cmd)$/
WhitespaceRegex = /\s+/
LowerCaseLetterRegex = /^[a-z]$/
UpperCaseLetterRegex = /^[A-Z]$/

KeyboardEventModifiers = new Set
KeyboardEventModifiers.add(modifier) for modifier in ['Control', 'Alt', 'Shift', 'Meta']
