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 TypeMethodDescriptionReturns an input stream that can be used to read characters from this terminal.rawMode()Switches this terminal to raw mode.voidread(TerminalInputListener listener) Reads the next character or control keys from this terminal.reset()Resets this terminal to its default mode.booleanReturns 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
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
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.
-