-</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 in-
- put). 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 rou-
- tines provide the same functionality as <STRONG>nodelay</STRONG>, plus the
- additional capability of being able to block for only <EM>de-</EM>
- <EM>lay</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 typeahead periodically while updating the
- screen. If input is found, and it is coming from a tty,
- the current update is postponed until <STRONG>refresh</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 fail-
- ure and OK (SVr4 specifies only "an integer value other
- than <STRONG>ERR</STRONG>") upon successful completion, unless otherwise
- noted in the preceding routine descriptions.
-
- X/Open does not define any error conditions. In this im-
- plementation, functions with a window parameter will re-
- turn an error if it is null. Any function will also re-
- turn an error if the terminal was not initialized. 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 his-
- torical 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 portabili-
- ty, set echo or noecho explicitly just after initializa-
- tion, even if your program remains in cooked mode.
-
- When <STRONG>keypad</STRONG> is first enabled, ncurses loads the key-defi-
- nitions for the current terminal description. If the ter-
- minal description includes extended string capabilities,
- e.g., from using the <STRONG>-x</STRONG> option of tic, then ncurses also
- defines keys for the capabilities whose names begin with
- "k". The corresponding keycodes are generated and (de-
- pending on previous loads of terminal descriptions) may
- differ from one execution of a program to the next. The
- generated keycodes are recognized by the <STRONG>keyname</STRONG> function
- (which will then return a name beginning with "k" denoting
- 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 establish a specific keycode for a given
- string. This makes it possible for an application to
- check for an extended capability's presence with <EM>tigetstr</EM>,
- and reassign the keycode to match its own needs.
-
- Low-level applications can use <STRONG>tigetstr</STRONG> to obtain the def-
- inition of any particular string capability. Higher-level
- applications which use the curses <STRONG>wgetch</STRONG> and similar func-
- tions 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 deter-
- mines 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 capability'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>node-</STRONG>
- <STRONG>lay</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
+</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, a blocking read is used (i.e.,
+ waits indefinitely for input). If <EM>delay</EM> is zero, then a non-blocking
+ read is used (i.e., <EM>read</EM> returns <STRONG>ERR</STRONG> if no input is waiting). If <EM>delay</EM>
+ is positive, then <EM>read</EM> 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>
+ <EM>curses</EM> does "line-breakout optimization" by looking for typeahead
+ periodically while updating the screen. If input is found, and it is
+ coming from a terminal, the current update is postponed until
+ <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> or <STRONG>doupdate</STRONG> is called again. This allows faster response
+ to commands typed in advance. Normally, the input <EM>FILE</EM> 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
+ descriptions.
+
+ X/Open Curses does not specify 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 initialized. Also,
+
+ <STRONG>halfdelay</STRONG>
+ returns an error if its parameter is outside the range 1..255.
+
+
+</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
+ <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 implemented as macros.
+
+ <STRONG>noraw</STRONG> and <STRONG>nocbreak</STRONG> follow historical practice in that they attempt to
+ restore normal ("cooked") mode from raw and cbreak modes respectively.
+ Mixing <STRONG>raw</STRONG>/<STRONG>noraw</STRONG> and <STRONG>cbreak</STRONG>/<STRONG>nocbreak</STRONG> calls leads to terminal driver
+ control states that are hard to predict or understand; doing so is not