]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_getch.3x
ncurses 6.0 - patch 20160423
[ncurses.git] / man / curs_getch.3x
index 8d94e0aad86117a4a4b19afc00534000e45e5e2a..1ef0601388a8fe5f344155b471ee715dbe207b71 100644 (file)
@@ -27,7 +27,7 @@
 .\" 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
@@ -118,9 +118,17 @@ returned by the next call to \fBwgetch\fR.
 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(/) ;
@@ -240,9 +248,14 @@ A few of these predefined values do \fInot\fP correspond to a real key:
 .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
@@ -347,6 +360,13 @@ implementation of handled signal receipt interrupts a \fBread\fR(2) call in
 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