@Override
  public ScreenView handleKeyPress(KeyPress keyPress) {
    switch (keyPress.getType()) {
      case Escape:
        return modeScreenPresenter.transitionToNextScreen(false);

      case Enter:
        return modeScreenPresenter.transitionToNextScreen(true);

      case ArrowUp:
        modeScreenPresenter.arrowUp();
        return this;

      case ArrowDown:
        modeScreenPresenter.arrowDown();
        return this;

      case PageUp:
      case Home:
        modeScreenPresenter.pageUp();
        return this;

      case PageDown:
      case End:
        modeScreenPresenter.pageDown();
        return this;

      default:
        // Do nothing
        break;
    }

    if (keyPress.getType() != KeyPress.Type.Character) {
      return this;
    }

    assert keyPress.getCharacter() != null;
    switch (keyPress.getCharacter()) {
      case 'q':
        return modeScreenPresenter.transitionToNextScreen(false);

      default:
        // Do nothing
        break;
    }

    return this;
  }
The screen where we can choose the {@link Mode} in the top screen.
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/screen/mode/ModeScreenView.java