+</PRE><H3><a name="h3-timeout_wtimeout">timeout/wtimeout</a></H3><PRE>
+ The <STRONG>timeout</STRONG> and <STRONG>wtimeout</STRONG> routines set blocking or non-blocking read for
+ a given window. If <EM>delay</EM> is negative, blocking read is used (i.e.,
+ waits indefinitely for input). If <EM>delay</EM> is zero, then non-blocking
+ read is used (i.e., read returns <STRONG>ERR</STRONG> if no input is waiting). If <EM>delay</EM>
+ is positive, then read blocks for <EM>delay</EM> milliseconds, and returns <STRONG>ERR</STRONG>
+ if there is still no input. Hence, these routines provide the same
+ functionality as <STRONG>nodelay</STRONG>, plus the additional capability of being able
+ to block for only <EM>delay</EM> milliseconds (where <EM>delay</EM> is positive).
+
+
+</PRE><H3><a name="h3-typeahead">typeahead</a></H3><PRE>
+ The <STRONG>curses</STRONG> library does "line-breakout optimization" by looking for ty-
+ peahead periodically while updating the screen. If input is found, and
+ it is coming from a tty, the current update is postponed until <STRONG>re-</STRONG>
+ <STRONG><A HREF="refresh.3x.html">fresh(3x)</A></STRONG> or <STRONG>doupdate</STRONG> is called again. This allows faster response to
+ commands typed in advance. Normally, the input FILE pointer passed to
+ <STRONG>newterm</STRONG>, or <STRONG>stdin</STRONG> in the case that <STRONG>initscr</STRONG> was used, will be used to do
+ this typeahead checking. The <STRONG>typeahead</STRONG> routine specifies that the file
+ descriptor <EM>fd</EM> is to be used to check for typeahead instead. If <EM>fd</EM> is
+ -1, then no typeahead checking is done.
+
+
+</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
+ All routines that return an integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG>
+ (SVr4 specifies only "an integer value other than <STRONG>ERR</STRONG>") upon successful
+ completion, unless otherwise noted in the preceding routine descrip-
+ tions.
+
+ X/Open does not define any error conditions. In this implementation,
+ functions with a window parameter will return an error if it is null.
+ Any function will also return an error if the terminal was not initial-
+ ized. Also,
+
+ <STRONG>halfdelay</STRONG>
+ returns an error if its parameter is outside the range
+ 1..255.
+
+
+</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
+ These functions are described in the XSI Curses standard, Issue 4.
+
+ The ncurses library obeys the XPG4 standard and the historical practice
+ of the AT&T curses implementations, in that the echo bit is cleared
+ when curses initializes the terminal state. BSD curses differed from
+ this slightly; it left the echo bit on at initialization, but the BSD
+ <STRONG>raw</STRONG> call turned it off as a side-effect. For best portability, set
+ <STRONG>echo</STRONG> or <STRONG>noecho</STRONG> explicitly just after initialization, even if your pro-
+ gram remains in cooked mode.
+
+ The XSI Curses standard is ambiguous on the question of whether <STRONG>raw</STRONG>
+ should disable the CRLF translations controlled by <STRONG>nl</STRONG> and <STRONG>nonl</STRONG>. BSD
+ curses did turn off these translations; AT&T curses (at least as late
+ as SVr1) did not. We chose to do so, on the theory that a programmer
+ requesting raw input wants a clean (ideally 8-bit clean) connection
+ that the operating system will not alter.
+
+ When <STRONG>keypad</STRONG> is first enabled, ncurses loads the key-definitions for the
+ current terminal description. If the terminal description includes ex-
+ tended string capabilities, e.g., from using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG>, then
+ ncurses also defines keys for the capabilities whose names begin with
+ "k". The corresponding keycodes are generated and (depending on previ-
+ ous loads of terminal descriptions) may differ from one execution of a
+ program to the next. The generated keycodes are recognized by the <STRONG>key-</STRONG>
+ <STRONG>name</STRONG> function (which will then return a name beginning with "k" denot-
+ ing the terminfo capability name rather than "K", used for curses key-
+ names). On the other hand, an application can use <STRONG>define_key</STRONG> to estab-
+ lish a specific keycode for a given string. This makes it possible for
+ an application to check for an extended capability's presence with
+ <STRONG>tigetstr</STRONG>, and reassign the keycode to match its own needs.
+
+ Low-level applications can use <STRONG>tigetstr</STRONG> to obtain the definition of any
+ particular string capability. Higher-level applications which use the
+ curses <STRONG>wgetch</STRONG> and similar functions to return keycodes rely upon the
+ order in which the strings are loaded. If more than one key definition
+ has the same string value, then <STRONG>wgetch</STRONG> can return only one keycode.
+ Most curses implementations (including ncurses) load key definitions in
+ the order defined by the array of string capability names. The last
+ key to be loaded determines the keycode which will be returned. In
+ ncurses, you may also have extended capabilities interpreted as key
+ definitions. These are loaded after the predefined keys, and if a ca-
+ pability's value is the same as a previously-loaded key definition, the
+ later definition is the one used.
+
+
+</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
+ Note that <STRONG>echo</STRONG>, <STRONG>noecho</STRONG>, <STRONG>halfdelay</STRONG>, <STRONG>intrflush</STRONG>, <STRONG>meta</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG>, <STRONG>nodelay</STRONG>,
+ <STRONG>notimeout</STRONG>, <STRONG>noqiflush</STRONG>, <STRONG>qiflush</STRONG>, <STRONG>timeout</STRONG>, and <STRONG>wtimeout</STRONG> may be macros.
+
+ The <STRONG>noraw</STRONG> and <STRONG>nocbreak</STRONG> calls follow historical practice in that they
+ attempt to restore to normal ("cooked") mode from raw and cbreak modes
+ respectively. Mixing raw/noraw and cbreak/nocbreak calls leads to tty
+ driver control states that are hard to predict or understand; it is not