1 .\"***************************************************************************
2 .\" Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a *
5 .\" copy of this software and associated documentation files (the *
6 .\" "Software"), to deal in the Software without restriction, including *
7 .\" without limitation the rights to use, copy, modify, merge, publish, *
8 .\" distribute, distribute with modifications, sublicense, and/or sell *
9 .\" copies of the Software, and to permit persons to whom the Software is *
10 .\" furnished to do so, subject to the following conditions: *
12 .\" The above copyright notice and this permission notice shall be included *
13 .\" in all copies or substantial portions of the Software. *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 .\" Except as contained in this notice, the name(s) of the above copyright *
24 .\" holders shall not be used in advertising or otherwise to promote the *
25 .\" sale, use or other dealings in this Software without prior written *
27 .\"***************************************************************************
29 .\" $Id: curs_get_wch.3x,v 1.7 2010/08/14 23:31:42 tom Exp $
36 \fBunget_wch\fR \- get (or push back) a wide character from curses terminal keyboard
38 \fB#include <curses.h>\fR
40 \fBint get_wch(wint_t *\fR\fIwch\fR\fB);\fR
42 \fBint wget_wch(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwch\fR\fB);\fR
44 \fBint mvget_wch(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwch\fR\fB);\fR
46 \fBint mvwget_wch(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwch\fR\fB);\fR
48 \fBint unget_wch(const wchar_t \fR\fIwch\fR\fB);\fR
55 functions read a character
56 from the terminal associated with the current or specified window.
58 if no input is waiting, the value \fBERR\fR is returned.
60 the program waits until the system passes text through to the program.
61 Depending on the setting of \fBcbreak\fR,
62 this is after one character (cbreak mode),
63 or after the first newline (nocbreak mode).
65 the program waits until the user types a character or the specified
66 timeout interval has elapsed.
68 Unless \fBnoecho\fR has been set,
69 these routines echo the character into the designated window.
71 If the window is not a pad and has been moved or modified since the
72 last call to \fBwrefresh\fR,
73 \fBwrefresh\fR will be called before another character is read.
75 If \fBkeypad\fR is enabled,
76 these functions respond to
77 the pressing of a function key by setting the object pointed to by
86 If a character (such as escape) that could be the
87 beginning of a function key is received, curses sets a timer.
89 of the sequence does arrive within the designated time, curses passes through
90 the character; otherwise, curses returns the function key value.
92 reason, many terminals experience a delay between the time a user presses
93 the escape key and the time the escape is returned to the program.
97 function pushes the wide character
99 back onto the head of the input queue, so the wide character
100 is returned by the next call to
103 one character is guaranteed.
106 too many times without an intervening call to
108 the operation may fail.
113 includes the header file
116 Applications should not define the escape key by itself as a single-character
123 \fBmvwget_wch\fR, applications should
130 Depending on the state of the tty driver when each character
131 is typed, the program may produce undesirable results.
133 All functions except \fBwget_wch\fR and \fBunget_wch\fR
141 functions successfully
142 report the pressing of a function key, they return
144 When they successfully report a wide character, they return
146 Otherwise, they return
149 Upon successful completion,
153 Otherwise, the function returns
156 Functions with a "mv" prefix first perform a cursor movement using
157 \fBwmove\fP, and return an error if the position is outside the window,
158 or if the window pointer is null.
162 \fBcurs_ins_wch\fR(3),
163 \fBcurs_inopts\fR(3),
165 \fBcurs_refresh\fR(3)