           break if context[keyName]
         context[keyName]?.call(this, event)
 
-
-      if event.ctrlKey or event.metaKey
+      if keyEventIsKeyboardCommand(event)
         if character = String.fromCharCode(event.keyCode).toLowerCase()
           keys = (modifier for modifier in ["alt", "shift"] when event["#{modifier}Key"])
           keys.push(character)

    keypress: (event) ->
      return if @isMobileInputModeEnabled()
      return if (event.metaKey or event.ctrlKey) and not event.altKey
      return if keypressEventIsWebInspectorShortcut(event)
      return if keypressEventIsPasteAndMatchStyleShortcut(event)

      if event.which is null
        character = String.fromCharCode event.keyCode

  extensionForFile = (file) ->
    file.type?.match(/\/(\w+)$/)?[1]

keyEventIsWebInspectorShortcut = (event) ->
  event.metaKey and event.altKey and not event.shiftKey and event.keyCode is 94

keyEventIsPasteAndMatchStyleShortcut = (event) ->
  event.metaKey and event.altKey and event.shiftKey and event.keyCode is 9674

keyEventIsKeyboardCommand = (event) ->
  if /Mac|^iP/.test(navigator.platform) then event.metaKey else event.ctrlKey
