.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_getch.3x,v 1.42 2015/07/21 08:44:04 tom Exp $
+.\" $Id: curs_getch.3x,v 1.44 2015/12/20 01:43:03 tom Exp $
.TH curs_getch 3X ""
.na
.hy 0
There is just one input queue for all windows.
.PP
.SS Predefined key-codes
-The following special keys, defined in \fB<curses.h>\fR, may be returned by
-\fBgetch\fR if \fBkeypad\fR has been enabled.
+The following special keys are defined in \fB<curses.h>\fR.
+.bP
+Except for the special case \fBKEY_RESIZE\fP,
+it is necessary to enable \fBkeypad\fR for \fBgetch\fP to return these codes.
+.bP
Not all of these are necessarily supported on any particular terminal.
+.bP
+The naming convention may seem obscure, with some apparent
+misspellings (such as "RSUME" for "resume").
+The names correspond to the long terminfo capability names for the keys,
+and were defined long ago, in the 1980s.
.PP
.TS
center tab(/) ;
.B KEY_RESIZE
is returned when the \fBSIGWINCH\fP signal has been detected
(see \fBinitscr\fP(3X) and \fBresizeterm\fR(3X)).
+This code is returned whether or not \fBkeypad\fP has been enabled.
.bP
.B KEY_MOUSE
is returned for mouse-events (see \fBcurs_mouse\fR(3X)).
+This code relies upon whether or not \fBkeypad\fP(3X) has been enabled,
+because (e.g., with \fIxterm\fP mouse prototocol) ncurses must
+read escape sequences,
+just like a function key.
.SS Testing key-codes
.PP
The \fBhas_key\fR routine takes a key-code value from the above list, and
progress or not, and also (in some implementations) depending on whether an
input timeout or non-blocking mode has been set.
.PP
+\fBKEY_MOUSE\fP is mentioned in XSI Curses, along with a few related
+terminfo capabilities, but no higher-level functions use the feature.
+The implementation in ncurses is an extension.
+.PP
+\fBKEY_RESIZE\fP is an extension first implemented for ncurses.
+NetBSD curses later added this extension.
+.PP
Programmers concerned about portability should be prepared for either of two
cases: (a) signal receipt does not interrupt \fBgetch\fR; (b) signal receipt
interrupts \fBgetch\fR and causes it to return ERR with \fBerrno\fR set to