Enum UnixLikeTerminal.CtrlCBehaviour

java.lang.Object
java.lang.Enum<UnixLikeTerminal.CtrlCBehaviour>
com.googlecode.lanterna.terminal.ansi.UnixLikeTerminal.CtrlCBehaviour
All Implemented Interfaces:
Serializable, Comparable<UnixLikeTerminal.CtrlCBehaviour>, java.lang.constant.Constable
Enclosing class:
UnixLikeTerminal

public static enum UnixLikeTerminal.CtrlCBehaviour extends Enum<UnixLikeTerminal.CtrlCBehaviour>
This enum lets you control how Lanterna will handle a ctrl+c keystroke from the user.
  • Enum Constant Details

    • TRAP

      public static final UnixLikeTerminal.CtrlCBehaviour TRAP
      Pressing ctrl+c doesn't kill the application, it will be added to the input queue as any other key stroke
    • CTRL_C_KILLS_APPLICATION

      public static final UnixLikeTerminal.CtrlCBehaviour CTRL_C_KILLS_APPLICATION
      Pressing ctrl+c will restore the terminal and kill the application as it normally does with terminal applications. Lanterna will restore the terminal and then call System.exit(1) for this.
  • Constructor Details

    • CtrlCBehaviour

      private CtrlCBehaviour()
  • Method Details

    • values

      public static UnixLikeTerminal.CtrlCBehaviour[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static UnixLikeTerminal.CtrlCBehaviour valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null