private void ctrlAndCharacter(char ch) {
    char ctrlCode;
    switch (ch) {
      case 0:
        ctrlCode = ' ';
        break;

      case 28:
        ctrlCode = '\\';
        break;

      case 29:
        ctrlCode = ']';
        break;

      case 30:
        ctrlCode = '^';
        break;

      case 31:
        ctrlCode = '_';
        break;

      default:
        ctrlCode = (char) ('a' - 1 + ch);
        break;
    }
    offer(new KeyPress(KeyPress.Type.Character, ctrlCode, false, true, false));
  }
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