Interface TerminalInput
-
- All Known Implementing Classes:
AbstractWindowsTerminalInput,PlainTerminalInput,PosixTerminalInput,WindowsTerminalInput
public interface TerminalInputAllows 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.InputStreamgetInputStream()Returns an input stream that can be used to read characters from this terminal.TerminalInputrawMode()Switches this terminal to raw mode.voidread(TerminalInputListener listener)Reads the next character or control keys from this terminal.TerminalInputreset()Resets this terminal to its default mode.booleansupportsRawMode()Returns true if this terminal supports setting raw mode.
-
-
-
Method Detail
-
getInputStream
java.io.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
TerminalInput reset() throws NativeException
Resets this terminal to its default mode.- Throws:
NativeException- On failure.
-
-