_onKeyDown (event) {
    const target = event.target
    const keynum = event.which
    let handled = false
    let buttons, targetIndex, prevButton, nextButton

    if (keynum === 27) { // ESC
      // hide the menu on ESC key

      // restore previous selection and focus
      if (this.selection) {
        setSelection(this.selection)
      }
      if (this.anchor) {
        this.anchor.focus()
      }

      this.hide()

      handled = true
    } else if (keynum === 9) { // Tab
      if (!event.shiftKey) { // Tab
        buttons = this._getVisibleButtons()
        targetIndex = buttons.indexOf(target)
        if (targetIndex === buttons.length - 1) {
          // move to first button
          buttons[0].focus()
          handled = true
        }
      } else { // Shift+Tab
        buttons = this._getVisibleButtons()
        targetIndex = buttons.indexOf(target)
        if (targetIndex === 0) {
          // move to last button
          buttons[buttons.length - 1].focus()
          handled = true
        }
      }
    } else if (keynum === 37) { // Arrow Left
      if (target.className === 'jsoneditor-expand') {
        buttons = this._getVisibleButtons()
        targetIndex = buttons.indexOf(target)
        prevButton = buttons[targetIndex - 1]
        if (prevButton) {
          prevButton.focus()
        }
      }
      handled = true
    } else if (keynum === 38) { // Arrow Up
      buttons = this._getVisibleButtons()
      targetIndex = buttons.indexOf(target)
      prevButton = buttons[targetIndex - 1]
      if (prevButton && prevButton.className === 'jsoneditor-expand') {
        // skip expand button
        prevButton = buttons[targetIndex - 2]
      }
      if (!prevButton) {
        // move to last button
        prevButton = buttons[buttons.length - 1]
      }
      if (prevButton) {
        prevButton.focus()
      }
      handled = true
    } else if (keynum === 39) { // Arrow Right
      buttons = this._getVisibleButtons()
      targetIndex = buttons.indexOf(target)
      nextButton = buttons[targetIndex + 1]
      if (nextButton && nextButton.className === 'jsoneditor-expand') {
        nextButton.focus()
      }
      handled = true
    } else if (keynum === 40) { // Arrow Down
      buttons = this._getVisibleButtons()
      targetIndex = buttons.indexOf(target)
      nextButton = buttons[targetIndex + 1]
      if (nextButton && nextButton.className === 'jsoneditor-expand') {
        // skip expand button
        nextButton = buttons[targetIndex + 2]
      }
      if (!nextButton) {
        // move to first button
        nextButton = buttons[0]
      }
      if (nextButton) {
        nextButton.focus()
        handled = true
      }
      handled = true
    }
    // TODO: arrow left and right

    if (handled) {
      event.stopPropagation()
      event.preventDefault()
    }
  }
Handle onkeydown event
@param {Event} event
@private