Interface TerminalInput

All Known Implementing Classes:
AbstractWindowsTerminalInput, PlainTerminalInput, PosixTerminalInput, WindowsTerminalInput

public interface TerminalInput
Allows input to be received from the terminal.

On UNIX based platforms, this provides access to the terminal. On Windows platforms, this provides access to the console.

To create an instance of this interface use the Terminals.getTerminalInput() method.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an input stream that can be used to read characters from this terminal.
    Switches this terminal to raw mode.
    void
    Reads the next character or control keys from this terminal.
    Resets this terminal to its default mode.
    boolean
    Returns true if this terminal supports setting raw mode.
  • Method Details

    • getInputStream

      InputStream getInputStream()
      Returns an input stream that can be used to read characters from this terminal.
    • read

      void read(TerminalInputListener listener) throws NativeException
      Reads the next character or control keys from this terminal. Blocks until an event is available.
      Throws:
      NativeException - On failure.
    • supportsRawMode

      boolean supportsRawMode()
      Returns true if this terminal supports setting raw mode.
    • rawMode

      TerminalInput rawMode() throws NativeException
      Switches this terminal to raw mode. Keys are delivered as they are typed, are not echoed and are not processed.
      Throws:
      NativeException - On failure, or when raw mode is not supported by this terminal.
    • reset

      Resets this terminal to its default mode.
      Throws:
      NativeException - On failure.