+</PRE><H3><a name="h3-Reading-characters">Reading characters</a></H3><PRE>
+ The <STRONG>getch</STRONG>, <STRONG>wgetch</STRONG>, <STRONG>mvgetch</STRONG> and <STRONG>mvwgetch</STRONG>, routines read a character from
+ the window. In no-delay mode, if no input is waiting, the value <STRONG>ERR</STRONG> is
+ returned. In delay mode, the program waits until the system passes
+ text through to the program. Depending on the setting of <STRONG>cbreak</STRONG>, this
+ is after one character (cbreak mode), or after the first newline
+ (nocbreak mode). In half-delay mode, the program waits until a charac-
+ ter is typed or the specified timeout has been reached.
+
+ If <STRONG>echo</STRONG> is enabled, and the window is not a pad, then the character
+ will also be echoed into the designated window according to the follow-
+ ing rules:
+
+ <STRONG>o</STRONG> If the character is the current erase character, left arrow, or
+ backspace, the cursor is moved one space to the left and that
+ screen position is erased as if <STRONG>delch</STRONG> had been called.
+
+ <STRONG>o</STRONG> If the character value is any other <STRONG>KEY_</STRONG> define, the user is alert-
+ ed with a <STRONG>beep</STRONG> call.
+
+ <STRONG>o</STRONG> If the character is a carriage-return, and if <STRONG>nl</STRONG> is enabled, it is
+ translated to a line-feed after echoing.
+
+ <STRONG>o</STRONG> Otherwise the character is simply output to the screen.
+
+ If the window is not a pad, and it has been moved or modified since the
+ last call to <STRONG>wrefresh</STRONG>, <STRONG>wrefresh</STRONG> will be called before another character
+ is read.
+
+
+</PRE><H3><a name="h3-Keypad-mode">Keypad mode</a></H3><PRE>
+ If <STRONG>keypad</STRONG> is <STRONG>TRUE</STRONG>, and a function key is pressed, the token for that
+ function key is returned instead of the raw characters:
+
+ <STRONG>o</STRONG> The predefined function keys are listed in <STRONG><curses.h></STRONG> as macros
+ with values outside the range of 8-bit characters. Their names be-
+ gin with <STRONG>KEY_</STRONG>.
+
+ <STRONG>o</STRONG> Other (user-defined) function keys which may be defined using <STRONG>de-</STRONG>
+ <STRONG><A HREF="define_key.3x.html">fine_key(3x)</A></STRONG> have no names, but also are expected to have values
+ outside the range of 8-bit characters.
+
+ Thus, a variable intended to hold the return value of a function key
+ must be of short size or larger.
+
+ When a character that could be the beginning of a function key is re-
+ ceived (which, on modern terminals, means an escape character), <STRONG>curses</STRONG>
+ sets a timer. If the remainder of the sequence does not come in within
+ the designated time, the character is passed through; otherwise, the
+ function key value is returned. For this reason, many terminals expe-
+ rience a delay between the time a user presses the escape 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 be returned
+ by the next call to <STRONG>wgetch</STRONG>. There is just one input queue for all win-
+ dows.
+
+
+</PRE><H3><a name="h3-Predefined-key-codes">Predefined key-codes</a></H3><PRE>
+ The following special keys are defined in <STRONG><curses.h></STRONG>.
+
+ <STRONG>o</STRONG> Except for the special case <STRONG>KEY_RESIZE</STRONG>, it is necessary to enable
+ <STRONG>keypad</STRONG> for <STRONG>getch</STRONG> to return these codes.
+
+ <STRONG>o</STRONG> Not all of these are necessarily supported on any particular termi-
+ nal.
+
+ <STRONG>o</STRONG> The naming convention may seem obscure, with some apparent mis-
+ spellings (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.
+
+ <EM>Name</EM> <EM>Key</EM> <EM>name</EM>
+ -------------------------------------------------
+ KEY_BREAK Break key
+ KEY_DOWN The four arrow keys ...
+ KEY_UP
+ KEY_LEFT
+ KEY_RIGHT
+ KEY_HOME Home key (upward+left arrow)
+ KEY_BACKSPACE Backspace
+ KEY_F0 Function keys; space for 64 keys
+ is reserved.
+ KEY_F(<EM>n</EM>) For 0 <= <EM>n</EM> <= 63
+ KEY_DL Delete line
+ KEY_IL Insert line
+ KEY_DC Delete character
+ KEY_IC Insert char or enter insert mode
+ KEY_EIC Exit insert char mode
+ KEY_CLEAR Clear screen
+ KEY_EOS Clear to end of screen
+ KEY_EOL Clear to end of line
+ KEY_SF Scroll 1 line forward
+ 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_ENTER Enter or send
+ KEY_SRESET Soft (partial) reset
+ 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_C1 Lower left of keypad
+ KEY_C3 Lower right of keypad
+ KEY_BTAB Back tab key
+ KEY_BEG Beg(inning) key
+ KEY_CANCEL Cancel key
+ KEY_CLOSE Close key
+ KEY_COMMAND Cmd (command) key
+ KEY_COPY Copy key
+ KEY_CREATE Create key
+ KEY_END End key
+ KEY_EXIT Exit key
+ 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
+ KEY_PREVIOUS Previous object key
+ KEY_REDO Redo key
+ KEY_REFERENCE Ref(erence) key
+ KEY_REFRESH Refresh key
+ KEY_REPLACE Replace key
+ KEY_RESIZE Screen resized
+ KEY_RESTART Restart key
+ KEY_RESUME Resume key
+ KEY_SAVE Save key
+ KEY_SBEG Shifted beginning key
+ KEY_SCANCEL Shifted cancel key
+ KEY_SCOMMAND Shifted command key
+ KEY_SCOPY Shifted copy key
+ KEY_SCREATE Shifted create key
+ KEY_SDC Shifted delete char key
+ KEY_SDL Shifted delete line key
+ KEY_SELECT Select key
+ KEY_SEND Shifted end key
+ KEY_SEOL Shifted clear line key
+ KEY_SEXIT Shifted exit key
+ KEY_SFIND Shifted find key
+ KEY_SHELP Shifted help key
+ KEY_SHOME Shifted home key
+ KEY_SIC Shifted input key
+ KEY_SLEFT Shifted left arrow key
+ KEY_SMESSAGE Shifted message key
+ KEY_SMOVE Shifted move key
+ KEY_SNEXT Shifted next key
+ KEY_SOPTIONS Shifted options key
+ KEY_SPREVIOUS Shifted prev key
+ KEY_SPRINT Shifted print key
+ 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
+ KEY_SUNDO Shifted undo key
+ KEY_SUSPEND Suspend key
+ KEY_UNDO Undo key