1get_wch(3XCURSES) X/Open Curses Library Functions get_wch(3XCURSES)
2
3
4
6 get_wch, wget_wch, mvget_wch, mvwget_wch - get a wide character from
7 terminal
8
10 cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib \
11 -R /usr/xpg4/lib -lcurses [ library... ]
12
13 c89 [ flag... ] file... -lcurses [ library... ]
14
15 #include <curses.h>
16
17 int get_wch(wint_t *ch);
18
19
20 int wget_wch(WINDOW *win, wint_t *ch);
21
22
23 int mvget_wch(int y, int x, wint_t *ch);
24
25
26 int mvwget_wch(WINDOW *win, int y, int x, wint_t *ch);
27
28
30 The get_wch() and wget_wch() functions get a wide character from the
31 terminal associated with the window stdscr or window win, respec‐
32 tively. The mvget_wch() and mvwget_wch() functions move the cursor to
33 the position specified in stdscr or win, respectively, then get a char‐
34 acter.
35
36
37 If the window is not a pad and has been changed since the last call to
38 refresh(3XCURSES), get_wch() calls refresh() to update the window
39 before the next character is read.
40
41
42 The setting of certain functions affects the behavior of the get_wch()
43 set of functions. For example, if cbreak(3XCURSES) is set, characters
44 typed by the user are immediately processed. If halfdelay(3XCURSES) is
45 set, get_wch() waits until a character is typed or returns ERR if no
46 character is typed within the specified timeout period. This timeout
47 can also be specified for individual windows with the delay parameter
48 of timeout(3XCURSES) A negative value waits for input; a value of 0
49 returns ERR if no input is ready; a positive value blocks until input
50 arrives or the time specified expires (in which case ERR is returned).
51 If nodelay(3XCURSES) is set, ERR is returned if no input is waiting;
52 if not set, get_wch() waits until input arrives. Each character will
53 be echoed to the window unless noecho(3XCURSES) has been set.
54
55
56 If keypad handling is enabled ( keypad(3XCURSES) is TRUE), the token
57 for the function key (a KEY_ value) is stored in the object pointed to
58 by ch and KEY_CODE_YES is returned. If a character is received that
59 could be the beginning of a function key (for example, ESC), an inter-
60 byte timer is set. If the remainder of the sequence is not received
61 before the time expires, the character is passed through; otherwise,
62 the value of the function key is returned. If notimeout() is set, the
63 inter-byte timer is not used.
64
65
66 The ESC key is typically a prefix key used with function keys and
67 should not be used as a single character.
68
69
70 See the getch(3XCURSES) manual page for a list of tokens for function
71 keys that are returned by the get_wch() set of functions if keypad
72 handling is enabled (Some terminals may not support all tokens).
73
75 ch Is a pointer to a wide integer where the returned wide character
76 or KEY_ value can be stored.
77
78
79 win Is a pointer to the window associated with the terminal from
80 which the character is to be read.
81
82
83 y Is the y (row) coordinate for the position of the character to
84 be read.
85
86
87 x Is the x (column) coordinate for the position of the character
88 to be read.
89
90
92 When these functions successfully report the pressing of a function
93 key, they return KEY_CODE_YES. When they successfully report a wide
94 character, they return OK. Otherwise, they return ERR.
95
97 None.
98
100 See attributes(5) for descriptions of the following attributes:
101
102
103
104
105 ┌─────────────────────────────┬─────────────────────────────┐
106 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
107 ├─────────────────────────────┼─────────────────────────────┤
108 │Interface Stability │Standard │
109 ├─────────────────────────────┼─────────────────────────────┤
110 │MT-Level │Unsafe │
111 └─────────────────────────────┴─────────────────────────────┘
112
114 cbreak(3XCURSES), echo(3XCURSES), halfdelay(3XCURSES), key‐
115 pad(3XCURSES), libcurses(3XCURSES), nodelay(3XCURSES), notime‐
116 out(3XCURSES), raw(3XCURSES), timeout(3XCURSES), attributes(5), stan‐
117 dards(5)
118
119
120
121SunOS 5.11 5 Jun 2002 get_wch(3XCURSES)