-
- All Known Subinterfaces:
ExtendedTerminal
,IOSafeExtendedTerminal
,IOSafeTerminal
,Screen
,Terminal
,VirtualTerminal
- All Known Implementing Classes:
AbstractScreen
,AbstractTerminal
,ANSITerminal
,AWTTerminal
,AWTTerminalFrame
,AWTTerminalImplementation
,CygwinTerminal
,DefaultVirtualTerminal
,GraphicalTerminalImplementation
,IOSafeTerminalAdapter
,IOSafeTerminalAdapter.Extended
,ScrollingAWTTerminal
,ScrollingSwingTerminal
,StreamBasedTerminal
,SwingTerminal
,SwingTerminalFrame
,SwingTerminalImplementation
,TelnetTerminal
,TerminalScreen
,UnixLikeTerminal
,UnixLikeTTYTerminal
,UnixTerminal
,VirtualScreen
public interface InputProvider
Objects implementing this interface can read character streams and transform them intoKey
objects which can be read in a FIFO manner.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description KeyStroke
pollInput()
Returns the nextKey
off the input queue or null if there is no more input events available.KeyStroke
readInput()
Returns the nextKey
off the input queue or blocks until one is available.
-
-
-
Method Detail
-
pollInput
KeyStroke pollInput() throws java.io.IOException
Returns the nextKey
off the input queue or null if there is no more input events available. Note, this method call is not blocking, it returns null immediately if there is nothing on the input stream.- Returns:
- Key object which represents a keystroke coming in through the input stream
- Throws:
java.io.IOException
- Propagated error if the underlying stream gave errors
-
readInput
KeyStroke readInput() throws java.io.IOException
Returns the nextKey
off the input queue or blocks until one is available. NOTE: In previous versions of Lanterna, this method was not blocking. From lanterna 3, it is blocking and you can callpollInput()
for the non-blocking version.- Returns:
- Key object which represents a keystroke coming in through the input stream
- Throws:
java.io.IOException
- Propagated error if the underlying stream gave errors
-
-