Struct RealTimeConsoleInput
Encapsulates the stream of input events received from the terminal input.
struct RealTimeConsoleInput;
Constructors
| Name | Description |
this
(terminal, flags)
|
To capture input, you need to provide a terminal and some flags.
|
Methods
| Name | Description |
getch
(nonblocking)
|
Get one key press from the terminal, discarding other
events in the process. Returns dchar.init upon receiving end-of-file.
|
injectEvent
(ce)
|
Injects a custom event into the terminal input queue.
|
integrateWithSimpleDisplayEventLoop
(userEventHandler)
|
If you are using [arsd.simpledisplay] and want terminal interop too, you can call
this function to add it to the sdpy event loop and get the callback called on new
input.
|
kbhit
()
|
Returns true if there iff getch() would not block.
|
nextEvent
()
|
Returns the next event.
|
requestPasteFromClipboard
()
|
Requests the system to send paste data as a [PasteEvent] to this stream, if possible.
|
requestPasteFromPrimary
()
|
Requests the system to send paste data as a [PasteEvent] to this stream, if possible.
|
timedCheckForInput
(milliseconds)
|
Check for input, waiting no longer than the number of milliseconds. Note that this doesn't necessarily mean [getch] will not block, use this AND [kbhit] for that case.
|