X/Open Curses Library Functions getwch(3XCURSES)
NAME
getwch, wgetwch, mvgetwch, mvwgetwch - get a wide char-
acter from terminal
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib \
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include
int getwch(wintt *ch);
int wgetwch(WINDOW *win, wintt *ch);
int mvgetwch(int y, int x, wintt *ch);
int mvwgetwch(WINDOW *win, int y, int x, wintt *ch);
DESCRIPTION
The getwch() and wgetwch() functions get a wide character
from the terminal associated with the window stdscr or win-
dow win, respectively. The mvgetwch() and mvwgetwch()
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), getwch() calls refresh()
to update the window before the next character is read.
The setting of certain functions affects the behavior of the
getwch() set of functions. For example, if
cbreak(3XCURSES) is set, characters typed by the user are
immediately processed. If halfdelay(3XCURSES) is set,
getwch() waits until a character is typed or returns ER
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 ER if
no input is ready; a positive value blocks until input
arrives or the time specified expires (in which case ER is
returned). If nodelay(3XCURSES) is set, ER is returned if
no input is waiting; if not set, getwch() waits until
input arrives. Each character will be echoed to the window
unless noecho(3XCURSES) has been set.
SunOS 5.11 Last change: 5 Jun 2002 1
X/Open Curses Library Functions getwch(3XCURSES)
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 KEYCODEYES 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 getwch() set of
functions if keypad handling is enabled (Some terminals may
not support all tokens).
PARAMETERS
ch Is a pointer to a wide integer where the returned
wide character or KEY value can be stored.
win Is a pointer to the window associated with the termi-
nal from which the character is to be read.
y Is the y (row) coordinate for the position of the
character to be read.
x Is the x (column) coordinate for the position of the
character to be read.
RETURN VALUES
When these functions successfully report the pressing of a
function key, they return KEYCODEYES. When they success-
fully report a wide character, they return OK. Otherwise,
they return ER.
ERORS
None.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 5 Jun 2002 2
X/Open Curses Library Functions getwch(3XCURSES)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Standard
MT-Level Unsafe
SEE ALSO
cbreak(3XCURSES), echo(3XCURSES), halfdelay(3XCURSES),
keypad(3XCURSES), libcurses(3XCURSES), nodelay(3XCURSES),
notimeout(3XCURSES), raw(3XCURSES), timeout(3XCURSES),
attributes(5), standards(5)
SunOS 5.11 Last change: 5 Jun 2002 3
|