From 6d6afe788c3ec1f320e12449eee230fb366228c5 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Wed, 18 Jan 2012 14:03:39 +0000 Subject: Allow passing fd = -1 to constructor to make an instance not associated with an fd; must use push_bytes to provide it input --- man/termkey_new.3 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'man/termkey_new.3') diff --git a/man/termkey_new.3 b/man/termkey_new.3 index e4a3a37..b9ded7b 100644 --- a/man/termkey_new.3 +++ b/man/termkey_new.3 @@ -12,10 +12,12 @@ termkey_new, termkey_destroy \- create or destroy new termkey instance .sp Link with \fI\-ltermkey\fP. .SH DESCRIPTION -\fBtermkey_new\fP() creates a new termkey instance connected to the file handle opened by \fIfd\fP using the \fIflags\fP. The \fITermKey\fP structure should be considered opaque; its contents are not intended for use outside of the library. +\fBtermkey_new\fP() creates a new termkey instance connected to the file handle opened by \fIfd\fP using the \fIflags\fP. The \fITermKey\fP structure should be considered opaque; its contents are not intended for use outside of the library. If \fIfd\fP is given the value -1, then no file handle will be associated. .PP \fBtermkey_destroy\fP() destroys the given instance and releases any resources controlled by it. It will not close the underlying filehandle given as the \fIfd\fP argument to \fBtermkey_new\fP(). .PP +A termkey instance contains a buffer of bytes representing keypresses yet to be returned to the application. This buffer may be fed bytes directly by calling \fBtermkey_push_bytes\fP(3), or by calling \fBtermkey_advisereadable\fP(3) which itself will \fBread\fP(3) them from the filehandle given by \fIfd\fP. Once in the buffer, these bytes can be returned as key press events by calling \fBtermkey_getkey\fP(3). The read and get operations are combined in a single function \fBtermkey_waitkey\fP(3), which may be more convenient to use in the standard case of blocking reads from the \fIstdin\fP filehandle. +.PP The following values may be given as the \fIflags\fP bitmask: .TP .B TERMKEY_FLAG_NOINTERPRET -- cgit v1.2.3