Class PosixTerminalInput
- java.lang.Object
-
- net.rubygrapefruit.platform.internal.PosixTerminalInput
-
- All Implemented Interfaces:
TerminalInput
public class PosixTerminalInput extends java.lang.Object implements TerminalInput
Assumes vt100 input control sequences: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
-
-
Constructor Summary
Constructors Constructor Description PosixTerminalInput()
-
Method Summary
All Methods Instance Methods Concrete 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.java.lang.StringtoString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getInputStream
public java.io.InputStream getInputStream()
Description copied from interface:TerminalInputReturns an input stream that can be used to read characters from this terminal.- Specified by:
getInputStreamin interfaceTerminalInput
-
read
public void read(TerminalInputListener listener)
Description copied from interface:TerminalInputReads the next character or control keys from this terminal. Blocks until an event is available.- Specified by:
readin interfaceTerminalInput
-
supportsRawMode
public boolean supportsRawMode()
Description copied from interface:TerminalInputReturns true if this terminal supports setting raw mode.- Specified by:
supportsRawModein interfaceTerminalInput
-
rawMode
public TerminalInput rawMode() throws NativeException
Description copied from interface:TerminalInputSwitches this terminal to raw mode. Keys are delivered as they are typed, are not echoed and are not processed.- Specified by:
rawModein interfaceTerminalInput- Throws:
NativeException- On failure, or when raw mode is not supported by this terminal.
-
reset
public TerminalInput reset()
Description copied from interface:TerminalInputResets this terminal to its default mode.- Specified by:
resetin interfaceTerminalInput
-
-