code: function handleKeyBinding(cm, e) {
    let name = keyName(e, true)
    if (!name) return false
  
    if (e.shiftKey && !cm.state.keySeq) {
      // First try to resolve full name (including 'Shift-'). Failing
      // that, see if there is a cursor-motion command (starting with
      // 'go') bound to the keyname without 'Shift-'.
      return dispatchKey(cm, "Shift-" + name, e, b => doHandleBinding(cm, b, true))
          || dispatchKey(cm, name, e, b => {
               if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
                 return doHandleBinding(cm, b)
             })
    } else {
      return dispatchKey(cm, name, e, b => doHandleBinding(cm, b))
    }
  }
docs: Handle a key from the keydown event.