aboutsummaryrefslogtreecommitdiff
path: root/man/termkey_new.3
diff options
context:
space:
mode:
Diffstat (limited to 'man/termkey_new.3')
-rw-r--r--man/termkey_new.34
1 files changed, 3 insertions, 1 deletions
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