private void offer(KeyPress keyPress) {
    // Handle ctrl + c
    if (
      keyPress.isCtrl() && keyPress.getType() == KeyPress.Type.Character
        && keyPress.getCharacter() == 'c'
    ) {
      System.exit(0);
    }

    keyPressQueue.offer(keyPress);
  }
This generates {@link KeyPress} objects from the given input stream and offers them to the given
queue.
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/terminal/impl/KeyPressGenerator.java