The get_wch() and wget_wch() functions get a wide character from the terminal associated with the window stdscr or window win, respectively. The mvget_wch() and mvwget_wch() functions move the cursor to the position specified in stdscr or win, respectively, then get a character.
If the window is not a pad and has been changed since the last call to refresh(3XCURSES), get_wch() calls refresh() to update the window before the next character is read.
The setting of certain functions affects the behavior of the get_wch() set of functions. For example, if cbreak(3XCURSES) is set, characters typed by the user are immediately processed. If halfdelay(3XCURSES) is set, get_wch() waits until a character is typed or returns ERR if no character is typed within the specified
timeout period. This timeout can also be specified for individual windows with the delay parameter of timeout (3XCURSES) A negative value waits for input; a value of 0 returns ERR if no input is ready; a positive value blocks until
input arrives or the time specified expires (in which case ERR is returned). If nodelay(3XCURSES) is set, ERR is returned if no input is waiting; if not set, get_wch() waits until input arrives. Each character will be
echoed to the window unless noecho(3XCURSES) has been set.
If keypad handling is enabled ( keypad(3XCURSES) is TRUE), the token
for the function key (a KEY_ value) is stored in the object pointed to by ch and KEY_CODE_YES is returned. If a character is received that
could be the beginning of a function key (for example, ESC), an inter-byte timer is set. If the remainder of the sequence is not received before the time expires, the character is passed
through; otherwise, the value of the function key is returned. If notimeout() is set, the inter-byte timer is not used.
The ESC key is typically a prefix key used with function keys and should not be used as a single character.
See the getch(3XCURSES) manual page for a list of tokens for function keys that are returned
by the get_wch() set of functions if keypad handling is enabled (Some terminals may not support all tokens).
|