diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-01-18 14:03:39 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-01-18 14:03:39 +0000 |
commit | 6d6afe788c3ec1f320e12449eee230fb366228c5 (patch) | |
tree | a7f17b111e20dbe67bcaf5067f2ecd9c00d9f1db /man/termkey_new.3 | |
parent | 82ad14175cbcc7c0c660720c7a31f8e6f1cefe4e (diff) | |
download | termo-6d6afe788c3ec1f320e12449eee230fb366228c5.tar.gz termo-6d6afe788c3ec1f320e12449eee230fb366228c5.tar.xz termo-6d6afe788c3ec1f320e12449eee230fb366228c5.zip |
Allow passing fd = -1 to constructor to make an instance not associated with an fd; must use push_bytes to provide it input
Diffstat (limited to 'man/termkey_new.3')
-rw-r--r-- | man/termkey_new.3 | 4 |
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 |