public final boolean dispatch(KeyEvent event) {
    if (anyModalWindowsKeepPopupOpen()) {
      return false; // Popups should not process key events if there's a modal dialog on top of them.
    }
    if (event.getID() == KeyEvent.KEY_PRESSED) {
      myKeyPressedReceived = true;
      final KeyStroke stroke = KeyStroke.getKeyStroke(event.getKeyCode(), event.getModifiers(), false);
      if (proceedKeyEvent(event, stroke)) return true;
    }
    else if (!myKeyPressedReceived && !(this instanceof ComboBoxPopup)) {
      // key was pressed while this popup wasn't active, ignore the event
      return false;
    }

    if (event.getID() == KeyEvent.KEY_RELEASED) {
      final KeyStroke stroke = KeyStroke.getKeyStroke(event.getKeyCode(), event.getModifiers(), true);
      return proceedKeyEvent(event, stroke);
    }

    myMnemonicsSearch.processKeyEvent(event);
    processKeyEvent(event);

    if (event.isConsumed()) return true;
    process(event);
    return event.isConsumed();
  }
public final boolean dispatch(KeyEvent event)