aboutsummaryrefslogtreecommitdiff
path: root/man/termkey_new.3
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-21 00:52:13 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-21 00:52:13 +0000
commitdc5ce2331628be2a59eb849e07040d5e76a1f49c (patch)
tree6cac3f18997eb7c30886d217c3bcbebffb16e2c4 /man/termkey_new.3
parentc3de4f7801991f13d5a334f3450f766afda2bea7 (diff)
downloadtermo-dc5ce2331628be2a59eb849e07040d5e76a1f49c.tar.gz
termo-dc5ce2331628be2a59eb849e07040d5e76a1f49c.tar.xz
termo-dc5ce2331628be2a59eb849e07040d5e76a1f49c.zip
Link to termkey(7) from other manpages, delete some of the duplicated sections
Diffstat (limited to 'man/termkey_new.3')
-rw-r--r--man/termkey_new.337
1 files changed, 3 insertions, 34 deletions
diff --git a/man/termkey_new.3 b/man/termkey_new.3
index c4e5783..5e35ff1 100644
--- a/man/termkey_new.3
+++ b/man/termkey_new.3
@@ -12,42 +12,10 @@ 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. If \fIfd\fP is given the value -1, then no file handle will be associated.
+\fBtermkey_new\fP() creates a new \fBtermkey\fP(7) 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
-Do not attempt to interpret \fBC0\fP codes into keysyms. Instead report them as plain "Ctrl-letter" events.
-.TP
-.B TERMKEY_FLAG_CONVERTKP
-Convert xterm's alternative keypad symbols into the plain
-.SM ASCII
-codes they would represent.
-.TP
-.B TERMKEY_FLAG_RAW
-Ignore locale settings; do not attempt to recombine UTF-8 sequences. Instead report only raw values.
-.TP
-.B TERMKEY_FLAG_UTF8
-Ignore locale settings; force UTF-8 recombining on. This flag overrides \fBTERMKEY_FLAG_RAW\fP.
-.TP
-.B TERMKEY_FLAG_NOTERMIOS
-Even if the terminal file descriptor \fIfd\fP represents a
-.SM TTY
-device, do not call the \fBtcsetattr\fP(3) \fBtermios\fP function on it to set it to canonical input mode.
-.TP
-.B TERMKEY_FLAG_SPACESYMBOL
-Report space as being a symbolic key rather than a Unicode codepoint.
-.TP
-.B TERMKEY_FLAG_CTRLC
-Disable the \fBSIGINT\fP behaviour of \fICtrl-C\fP. If this flag is provided, then \fICtrl-C\fP will be available as a normal keypress, rather than sending the process group a \fBSIGINT\fP. This flag only takes effect without \fBTERMKEY_FLAG_NOTERMIOS\fP; with it, none of the signal keys are disabled anyway.
-.TP
-.B TERMKEY_FLAG_EINTR
-Without this flag, IO operations are retried when interrupted by a signal (\fBEINTR\fP). With this flag the \fBTERMKEY_RES_ERROR\fP result is returned instead.
-.PP
When the constructor is invoked, it attempts to detect if the current locale is UTF-8 aware or not, and sets either the \fBTERMKEY_FLAG_UTF8\fP or \fBTERMKEY_FLAG_RAW\fP flag. One of these two bits will always be in effect. The current flags in effect can be obtained by \fBtermkey_get_flags\fP(3).
.PP
If a file handle is provided, the terminfo driver may send a string to the terminal before \fBtermkey_new\fP() returns to initialise it, or set the state correctly. This will not be done if no file handle is provided, or if the file handle is a pipe (\fBS_ISFIFO\fP()). In this case it will be the caller's responsibility to ensure the terminal is in the correct mode.
@@ -61,4 +29,5 @@ If successful, \fBtermkey_new\fP() returns a pointer to the new instance. On fai
.BR termkey_getkey (3),
.BR termkey_get_flags (3),
.BR termkey_get_fd (3),
-.BR termkey_get_buffer_remaining (3)
+.BR termkey_get_buffer_remaining (3),
+.BR termkey (7)