X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=doc%2Fhtml%2Fman%2Fcurs_getch.3x.html;h=1df5dd04f0b12e5ca3879ce56fc97a376b80706f;hb=45766a7ed44677f18ccf230f9bd720862d7c69c8;hp=3af0cc77543de1c9e96a1c84bcba3f37adb18ba1;hpb=027d0c57c4c4d6690e8d8727888d3282dbe9aa86;p=ncurses.git diff --git a/doc/html/man/curs_getch.3x.html b/doc/html/man/curs_getch.3x.html index 3af0cc77..1df5dd04 100644 --- a/doc/html/man/curs_getch.3x.html +++ b/doc/html/man/curs_getch.3x.html @@ -27,7 +27,7 @@ * sale, use or other dealings in this Software without prior written * * authorization. * **************************************************************************** - * @Id: curs_getch.3x,v 1.40 2015/04/11 10:23:49 tom Exp @ + * @Id: curs_getch.3x,v 1.43 2015/09/19 22:25:05 tom Exp @ --> @@ -57,15 +57,18 @@ #include <curses.h> int getch(void); - int wgetch(WINDOW *win); - int mvgetch(int y, int x); - int mvwgetch(WINDOW *win, int y, int x); - int ungetch(int ch); - int has_key(int ch); + int wgetch(WINDOW *win); + int mvgetch(int y, int x); + int mvwgetch(WINDOW *win, int y, int x); + int ungetch(int ch); + int has_key(int ch);

DESCRIPTION

+
+
+

Reading characters

        The getch, wgetch, mvgetch and mvwgetch, routines  read  a
        character  from the window.  In no-delay mode, if no input
        is waiting, the value ERR is returned.  In delay mode, the
@@ -99,6 +102,9 @@
        fied since the last call to  wrefresh,  wrefresh  will  be
        called before another character is read.
 
+
+
+

Keypad mode

        If  keypad is TRUE, and a function key is pressed, the to-
        ken for that function key is returned instead of  the  raw
        characters.   Possible function keys are defined in <curs-
@@ -116,17 +122,20 @@
        experience a delay between the time a user presses the es-
        cape key and the escape is returned to the program.
 
+
+
+

Ungetting characters

        The ungetch routine places ch back onto the input queue to
        be returned by the next call to wgetch.  There is just one
        input queue for all windows.
 
 
 
-

Function Keys

-       The following function keys, defined in <curses.h>,  might
-       be  returned  by  getch  if keypad has been enabled.  Note
-       that not all of these are  necessarily  supported  on  any
-       particular terminal.
+

Predefined key-codes

+       The following special keys, defined in <curses.h>, may  be
+       returned  by getch if keypad has been enabled.  Not all of
+       these are necessarily supported on any  particular  termi-
+       nal.
 
             Name            Key name
             -------------------------------------------------
@@ -177,10 +186,10 @@
             KEY_FIND        Find key
             KEY_HELP        Help key
             KEY_MARK        Mark key
+
             KEY_MESSAGE     Message key
             KEY_MOUSE       Mouse event read
             KEY_MOVE        Move key
-
             KEY_NEXT        Next object key
             KEY_OPEN        Open key
             KEY_OPTIONS     Options key
@@ -227,7 +236,6 @@
 
        Keypad is arranged like this:
 
-
                          +-----+------+-------+
                          | A1  |  up  |  A3   |
                          +-----+------+-------+
@@ -235,13 +243,36 @@
                          +-----+------+-------+
                          | C1  | down |  C3   |
                          +-----+------+-------+
-       The has_key routine takes a key value from the above list,
-       and returns TRUE or FALSE according to whether the current
-       terminal type recognizes a key with that value.  Note that
-       a  few  values  do  not  correspond  to  a real key, e.g.,
-       KEY_RESIZE and KEY_MOUSE.  See resizeterm(3x) for more de-
-       tails  about  KEY_RESIZE, and curs_mouse(3x) for a discus-
-       sion of KEY_MOUSE.
+       A few of these predefined values do not  correspond  to  a
+       real key:
+
+       o   KEY_RESIZE  is  returned  when the SIGWINCH signal has
+           been detected (see  curs_initscr(3x)  and  resizeterm(3x)).
+           This  code  is returned whether or not keypad has been
+           enabled.
+
+       o   KEY_MOUSE   is   returned   for   mouse-events    (see
+           curs_mouse(3x)).  This code relies upon whether or not
+           keypad(3x) has been enabled, because (e.g., with xterm
+           mouse  prototocol) ncurses must read escape sequences,
+           just like a function key.
+
+
+
+

Testing key-codes

+       The has_key routine takes a key-code value from the  above
+       list,  and  returns TRUE or FALSE according to whether the
+       current terminal type recognizes a key with that value.
+
+       The library also supports these extensions:
+
+          define_key
+               defines a key-code for a  given  string  (see  de-
+               fine_key(3x)).
+
+          key_defined
+               checks  if there is a key-code defined for a given
+               string (see key_defined(3x)).
 
 
 
@@ -269,14 +300,14 @@ up to one second while the keypad code looks for a follow- ing function-key sequence. - Note that some keys may be the same as commonly used con- - trol keys, e.g., KEY_ENTER versus control/M, KEY_BACKSPACE - versus control/H. Some curses implementations may differ - according to whether they treat these control keys spe- - cially (and ignore the terminfo), or use the terminfo def- - initions. Ncurses uses the terminfo definition. If it - says that KEY_ENTER is control/M, getch will return - KEY_ENTER when you press control/M. + Some keys may be the same as commonly used control keys, + e.g., KEY_ENTER versus control/M, KEY_BACKSPACE versus + control/H. Some curses implementations may differ accord- + ing to whether they treat these control keys specially + (and ignore the terminfo), or use the terminfo defini- + tions. Ncurses uses the terminfo definition. If it says + that KEY_ENTER is control/M, getch will return KEY_ENTER + when you press control/M. Generally, KEY_ENTER denotes the character(s) sent by the Enter key on the numeric keypad: @@ -333,6 +364,14 @@ mentations) depending on whether an input timeout or non- blocking mode has been set. + KEY_MOUSE is mentioned in XSI Curses, along with a few re- + lated terminfo capabilities, but no higher-level functions + use the feature. The implementation in ncurses is an ex- + tension. + + KEY_RESIZE is an extension first implemented for ncurses. + NetBSD curses later added this extension. + Programmers concerned about portability should be prepared for either of two cases: (a) signal receipt does not in- terrupt getch; (b) signal receipt interrupts getch and @@ -364,7 +403,11 @@
  • SYNOPSIS
  • DESCRIPTION
  • RETURN VALUE