2.2 Terminal Mode settings
========================
2.2.1 ECHO mode
---------------
* Function
Int echo ()/int noecho ()
* Description
1. ECHO mode: ECHO mode. ECHO mode is used to determine whether your input is displayed immediately.
2.2.2 CBREAK Mode
-----------------
* Function
Int cbreak ()/int nocbreak ()
* Description
1. The CBREAK mode is also used as the immediate input mode. In this mode, all the input characters are read one by one, except for DELETE or CTRL, which are still considered special control characters.
2. By default, the CBREAK mode is enabled.
3. In the old version of curses, you must replace cbreak () and nocbreak () with crmode ()
2.2.3 NEWLINE Mode
------------------
* Function
Int nl ()/int nonl ()
* Description
The NEWLINE mode determines whether the carriage return value is \ r \ n. When the input value is \ r \ n, whether or not it is combined as a return key
2.2.4 function key mode
-----------------
* Function
Int keypad (WINDOW * win, int flag)
* Parameter description
1. win points to the window where function key mode needs to be set
2. The flag is TRUE/FALSE to specify whether the mode is enabled or disabled.
* Description
1. generally, the direction keys and function keys cannot be read by functions such as wgetch. after function key mode is enabled, special characters are converted to curses. h. Some special keys defined internally.
2. Special keys defined in curses. h generally start with KEY _. The list is as follows:
* Minimum key value defined in KEY_MIN curses
* KEY_BREAK key
* KEY_DOWN direction key
* KEY_UP direction key
* KEY_LEFT direction key left
* KEY_RIGHT direction key right
* KEY_HOME key
* KEY_BACKSPACE return key
* KEY_F0 function key F0
* KEY_F (n) function key Fn
* KEY_DL row deletion key
* Insert and create a KEY_IL row
* KEY_DC character deletion key
* KEY_IC character insertion key
* Next page of KEY_NPAGE
* KEY_PPAGE Previous Page
* KEY_END key
* Maximum key value defined by KEY_MAX curses
2.2.5 RAW mode
--------------
* Function
Int raw ()/int noraw ()
* Description
* Users' input will be accepted immediately, and any special characters will no longer work. Instead, a corresponding signal will be generated.
* If both the CBREAK and RAW modes are set, only the RAW mode works.
2.2.6 delay Mode
---------------
* Function
Int halfdelay (int tenth)
* Parameter description
1. tenth specifies the time interval of the half-latency. The unit is 10 ms.
Int nodelay (WINDOW * win, bool bf)
* Parameter description
1. win points to the pointer that requires no delay mode window. bf decides to enable or disable this mode.
* Description
* The semi-delay mode is very similar to the cbrak mode. If all users are accepted immediately, the difference is that if the user does not input data within a period of time, the input function returns ERR immediately.
* The nocbreak () function can be used to cancel the half-delay mode of the terminal.
* The non-delay mode is mainly used to control the character input of the terminal. It enables the terminal Input Function to change from a blocking call to a non-blocking call.
This article is from the "dark day" blog, please be sure to keep this source http://darksun.blog.51cto.com/3874064/1281961