@Nullable
  @Override
  public ScreenView handleKeyPress(KeyPress keyPress) {
    switch (keyPress.getType()) {
      case Enter:
        topScreenPresenter.refresh(true);
        return topScreenPresenter.isIterationFinished() ? null : this;

      case ArrowUp:
        topScreenPresenter.arrowUp();
        return topScreenPresenter.isIterationFinished() ? null : this;

      case ArrowDown:
        topScreenPresenter.arrowDown();
        return topScreenPresenter.isIterationFinished() ? null : this;

      case ArrowLeft:
        topScreenPresenter.arrowLeft();
        return topScreenPresenter.isIterationFinished() ? null : this;

      case ArrowRight:
        topScreenPresenter.arrowRight();
        return topScreenPresenter.isIterationFinished() ? null : this;

      case PageUp:
        topScreenPresenter.pageUp();
        return topScreenPresenter.isIterationFinished() ? null : this;

      case PageDown:
        topScreenPresenter.pageDown();
        return topScreenPresenter.isIterationFinished() ? null : this;

      case Home:
        topScreenPresenter.home();
        return topScreenPresenter.isIterationFinished() ? null : this;

      case End:
        topScreenPresenter.end();
        return topScreenPresenter.isIterationFinished() ? null : this;

      case Escape:
        return null;

      default:
        // Do nothing
        break;
    }

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

    assert keyPress.getCharacter() != null;
    switch (keyPress.getCharacter()) {
      case 'R':
        topScreenPresenter.switchSortOrder();
        break;

      case 'f':
        cancelTimer();
        return topScreenPresenter.transitionToFieldScreen(getScreen(), getTerminal());

      case 'm':
        cancelTimer();
        return topScreenPresenter.transitionToModeScreen(getScreen(), getTerminal());

      case 'h':
        cancelTimer();
        return topScreenPresenter.transitionToHelpScreen(getScreen(), getTerminal());

      case 'd':
        cancelTimer();
        return topScreenPresenter.goToInputModeForRefreshDelay(getScreen(), getTerminal(),
          MESSAGE_ROW);

      case 'o':
        cancelTimer();
        if (keyPress.isCtrl()) {
          return topScreenPresenter.goToFilterDisplayMode(getScreen(), getTerminal(), MESSAGE_ROW);
        }
        return topScreenPresenter.goToInputModeForFilter(getScreen(), getTerminal(), MESSAGE_ROW,
          true);

      case 'O':
        cancelTimer();
        return topScreenPresenter.goToInputModeForFilter(getScreen(), getTerminal(), MESSAGE_ROW,
          false);

      case '=':
        topScreenPresenter.clearFilters();
        break;

      case 'X':
        topScreenPresenter.adjustFieldLength();
        break;

      case 'i':
        topScreenPresenter.drillDown();
        break;

      case 'q':
        return null;

      default:
        return unknownCommandMessage();
    }
    return this;
  }
The screen that provides a dynamic real-time view for the HBase metrics. This shows the metric
{@link Summary} and the metric {@link Record}s. The summary and the metrics are updated
periodically (3 seconds by default).
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/screen/top/TopScreenView.java