]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - doc/html/man/curs_getch.3x.html
ncurses 6.0 - patch 20170401
[ncurses.git] / doc / html / man / curs_getch.3x.html
index 90d336f955c5605711e4228d2e548af1e6ddf719..d19c4b87454eea094ac47dad7dec1e085756245e 100644 (file)
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_getch.3x,v 1.45 2016/05/15 01:05:18 tom Exp @
+  * @Id: curs_getch.3x,v 1.49 2016/10/15 16:44:01 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
        experience a delay between the time a user presses the es-
        cape key and the escape is returned to the program.
 
+       In <STRONG>ncurses</STRONG>, the timer normally expires after the value  in
+       <STRONG>ESCDELAY</STRONG>  (see <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>).  If <STRONG>notimeout</STRONG> is <STRONG>TRUE</STRONG>,
+       the timer does not expire; it  is  an  infinite  (or  very
+       large) value.  Because function keys usually begin with an
+       escape character, the terminal may appear to hang  in  no-
+       timeout  mode  after pressing the escape key until another
+       key is pressed.
+
 
 </PRE><H3><a name="h3-Ungetting-characters">Ungetting characters</a></H3><PRE>
        The <STRONG>ungetch</STRONG> routine places <EM>ch</EM> back onto the input queue to
             KEY_SR          Scroll 1 line backward (reverse)
             KEY_NPAGE       Next page
             KEY_PPAGE       Previous page
+
             KEY_STAB        Set tab
             KEY_CTAB        Clear tab
             KEY_CATAB       Clear all tabs
             KEY_RESET       Reset or hard reset
             KEY_PRINT       Print or copy
             KEY_LL          Home down or bottom (lower left)
-
             KEY_A1          Upper left of keypad
             KEY_A3          Upper right of keypad
             KEY_B2          Center of keypad
             KEY_SREDO       Shifted redo key
             KEY_SREPLACE    Shifted replace key
             KEY_SRIGHT      Shifted right arrow
+
             KEY_SRSUME      Shifted resume key
             KEY_SSAVE       Shifted save key
             KEY_SSUSPEND    Shifted suspend key
        real key:
 
        <STRONG>o</STRONG>   <STRONG>KEY_RESIZE</STRONG> is returned when the  <STRONG>SIGWINCH</STRONG>  signal  has
-           been  detected  (see  <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG> and <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>).
+           been  detected  (see  <STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG> and <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>).
            This code is returned whether or not <STRONG>keypad</STRONG>  has  been
            enabled.
 
        <STRONG>o</STRONG>   <STRONG>KEY_MOUSE</STRONG>    is   returned   for   mouse-events   (see
            <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>).  This code relies upon whether or not
-           <STRONG><A HREF="keypad.3x.html">keypad(3x)</A></STRONG> has been enabled, because (e.g., with <EM>xterm</EM>
+           <STRONG><A HREF="curs_inopts.3x.html">keypad(3x)</A></STRONG> has been enabled, because (e.g., with <EM>xterm</EM>
            mouse prototocol) ncurses must read escape  sequences,
            just like a function key.
 
 
 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
        All  routines  return  the integer <STRONG>ERR</STRONG> upon failure and an
-       integer value other than <STRONG>ERR</STRONG> (<STRONG>OK</STRONG> in the case of ungetch())
+       integer value other than <STRONG>ERR</STRONG> (<STRONG>OK</STRONG> in the case  of  <STRONG>ungetch</STRONG>)
        upon successful completion.
 
           <STRONG>ungetch</STRONG>
 
           <STRONG>wgetch</STRONG>
                returns  ERR  if the window pointer is null, or if
-               its timeout expires without having any data.
+               its timeout expires without having any data, or if
+               the  execution  was interrupted by a signal (<STRONG>errno</STRONG>
+               will be set to <STRONG>EINTR</STRONG>).
 
        Functions with a "mv" prefix first perform a cursor  move-
        ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
        Programmers concerned about portability should be prepared
        for  either  of two cases: (a) signal receipt does not in-
        terrupt <STRONG>getch</STRONG>; (b) signal  receipt  interrupts  <STRONG>getch</STRONG>  and
-       causes  it  to  return ERR with <STRONG>errno</STRONG> set to <STRONG>EINTR</STRONG>.  Under
-       the <STRONG>ncurses</STRONG> implementation, handled signals  never  inter-
-       rupt <STRONG>getch</STRONG>.
+       causes it to return ERR with <STRONG>errno</STRONG> set to <STRONG>EINTR</STRONG>.
 
        The  <STRONG>has_key</STRONG>  function is unique to <STRONG>ncurses</STRONG>.  We recommend
        that any code using it be conditionalized  on  the  <STRONG>NCURS-</STRONG>
 
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,       <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>,       <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>,
-       <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>,   <STRONG><A HREF="curs_move.3x.html">curs_move(3x)</A></STRONG>,   <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,   <STRONG>re-</STRONG>
-       <STRONG><A HREF="resizeterm.3x.html">sizeterm(3x)</A></STRONG>.
+       <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>,      <STRONG><A HREF="curs_move.3x.html">curs_move(3x)</A></STRONG>,      <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,
+       <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>.
 
        Comparable  functions in the wide-character (ncursesw) li-
        brary are described in <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>.