Debian Codegraph @

upstream/opensuse-tumbleweed/man3/getch.3ncurses

raw
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2025,2026 Thomas E. Dickey *
4 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
5 .\" *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a *
7 .\" copy of this software and associated documentation files (the *
8 .\" "Software"), to deal in the Software without restriction, including *
9 .\" without limitation the rights to use, copy, modify, merge, publish, *
10 .\" distribute, distribute with modifications, sublicense, and/or sell *
11 .\" copies of the Software, and to permit persons to whom the Software is *
12 .\" furnished to do so, subject to the following conditions: *
13 .\" *
14 .\" The above copyright notice and this permission notice shall be included *
15 .\" in all copies or substantial portions of the Software. *
16 .\" *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 .\" *
25 .\" Except as contained in this notice, the name(s) of the above copyright *
26 .\" holders shall not be used in advertising or otherwise to promote the *
27 .\" sale, use or other dealings in this Software without prior written *
28 .\" authorization. *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: curs_getch.3x,v 1.136 2026/04/18 23:02:10 tom Exp $
32 .TH getch 3NCURSES 2026-04-18 "ncurses 6.6" "Library calls"
33 .ie \n(.g \{\
34 .ds `` \(lq
35 .ds '' \(rq
36 .ds ^ \(ha
37 .\}
38 .el \{\
39 .ie t .ds `` ``
40 .el .ds `` ""
41 .ie t .ds '' ''
42 .el .ds '' ""
43 .ds ^ ^
44 .\}
45 .
46 .ie \n(.g .ds : \:
47 .el .ds : \" empty
48 .
49 .de bP
50 .ie n .IP \(bu 4
51 .el .IP \(bu 2
52 ..
53 .SH NAME
54 \fB\%getch\fP,
55 \fB\%wgetch\fP,
56 \fB\%mvgetch\fP,
57 \fB\%mvwgetch\fP,
58 \fB\%ungetch\fP,
59 \fB\%has_key\fP \-
60 get (or push back) characters from \fIcurses\fR terminal keyboard buffer
61 .SH SYNOPSIS
62 .nf
63 .B #include <ncursesw/curses.h>
64 .PP
65 .B int getch(void);
66 .B int wgetch(WINDOW * \fIwin\fP);
67 .B int mvgetch(int \fIy\fP, int \fIx\fP);
68 .B int mvwgetch(WINDOW * \fIwin\fP, int \fIy\fP, int \fIx\fP);
69 .PP
70 .B int ungetch(int \fIc\fP);
71 .PP
72 .\" XXX: Move has_key into its own page like define_key and key_defined?
73 \fI/* extension */\fP
74 .B int has_key(int \fIc\fP);
75 .fi
76 .SH DESCRIPTION
77 .SS "Reading Characters"
78 .B \%wgetch
79 gathers a key event from the terminal input stream associated with a
80 .I curses
81 window
82 .IR win "."
83 \fB\%ncurses\fP(3NCURSES) describes the variants of this function.
84 .PP
85 When input is pending,
86 .B \%wgetch
87 returns an integer identifying the key event;
88 for alphanumeric and punctuation keys,
89 the space bar,
90 and (usually) the Backspace,
91 Tab,
92 Return,
93 and Escape keys,
94 this value corresponds to the character encoding used by the terminal.
95 Use of the control key as a modifier,
96 by holding it down while pressing and releasing another key,
97 often results in a distinct code.
98 The behavior of other keys depends on whether
99 .I win
100 is in keypad mode;
101 see subsection \*(``Keypad Mode\*('' below.
102 .PP
103 If no input is pending,
104 then if the no-delay flag is set in the window
105 (see \fB\%nodelay\fP(3NCURSES)),
106 the function returns
107 .BR ERR ";"
108 otherwise,
109 .I curses
110 waits until the terminal has input.
111 If \fB\%cbreak\fP(3NCURSES) or \fB\%raw\fP(3NCURSES)
112 has been called,
113 this happens after
114 .I curses
115 reads one key event.
116 If \fB\%nocbreak\fP(3NCURSES) or \fB\%noraw\fP(3NCURSES)
117 has been called,
118 it occurs when
119 .I curses
120 reads a newline.
121 .\" "newline" because canonical mode normalizes NL/CR
122 (Because the terminal's canonical or \*(``cooked\*('' mode
123 is line-buffered,
124 multiple
125 .B \%wgetch
126 calls may then be necessary to empty the input queue.)
127 If \fB\%halfdelay\fP(3NCURSES)
128 has been called,
129 .I curses
130 waits until input is available or the specified delay elapses.
131 .PP
132 If \fB\%echo\fP(3NCURSES) has been called,
133 and the window is not a pad,
134 .I curses
135 writes the returned character
136 .I c
137 to the window
138 (at the cursor position)
139 per the following rules.
140 .bP
141 If
142 .I c
143 matches the terminal's erase character
144 (see \fB\%erasechar\fP(3NCURSES)),
145 and the cursor is not at the window's leftmost column,
146 the cursor moves leftward one position
147 and the new position is erased
148 as if \fB\%wmove\fP(3NCURSES) and then \fB\%wdelch\fP(3NCURSES) were called.
149 When the window's keypad mode is enabled
150 (see below),
151 .B \%KEY_LEFT
152 and
153 .B \%KEY_BACKSPACE
154 are handled the same way.
155 .bP
156 .I curses
157 writes any other
158 .I c
159 to the window,
160 as with \fB\%wechochar\fP(3NCURSES).
161 .bP
162 If the window
163 .I win
164 has been moved or modified since the last call to
165 \fB\%wrefresh\fP(3NCURSES),
166 .I curses
167 calls
168 .B \%wrefresh
169 on it.
170 .PP
171 If
172 .I c
173 is a carriage return and \fBnl\fP(3NCURSES) has been called,
174 .B \%wgetch
175 returns the character code for line feed instead.
176 .SS "Keypad Mode"
177 Call \fB\%keypad\fP(3NCURSES) on a window to configure keypad mode
178 when reading input from it.
179 In
180 .IR "keypad mode" ","
181 .I curses
182 treats key strokes not from the alphabetic section of the keyboard
183 (those corresponding to the ECMA-6 character set \(em
184 see \fI\%ascii\fP(7) \(em
185 optionally modified by either the control or shift keys)
186 as
187 .I function
188 keys.
189 (In
190 .IR curses ","
191 the term \*(``function key\*('' includes but is not limited to keycaps
192 engraved with \*(``F1\*('',
193 \*(``PF1\*('',
194 and so on.)
195 If a window is in keypad mode,
196 .B \%wgetch
197 translates these key strokes to a numeric code corresponding to the
198 .B KEY_
199 symbols listed in subsection \*(``Key Codes\*('' below.
200 If the window is not in keypad mode,
201 the input queue populates with
202 the characters of the function key's escape sequence,
203 which the application must collect individually with multiple
204 .B \%wgetch
205 calls.
206 .bP
207 The
208 .I \%curses.h
209 header file declares many
210 .I "function keys"
211 whose names begin with
212 .BR KEY_ ";"
213 these object-like macros
214 have integer values outside the range of eight-bit character codes.
215 .bP
216 In
217 .IR \%ncurses ","
218 .I "user-defined function keys"
219 are configured with \fB\%define_key\fP(3NCURSES);
220 they have no names,
221 but are also expected to
222 have integer values outside the range of eight-bit character codes.
223 .PP
224 A variable intended to hold a function key code must thus be of type
225 .I short
226 or larger.
227 .PP
228 Most terminals one encounters follow the ECMA-48 standard insofar as
229 their function keys produce character sequences prefixed with the
230 escape character ESC.
231 This fact implies that
232 .I curses
233 cannot distinguish a user's press of the escape key
234 (assuming it sends ESC)
235 from the beginning of a function key's character sequence without
236 waiting to see if,
237 and how soon,
238 further input arrives.
239 .bP
240 If the escape sequence
241 matches a string capability defining a function key
242 for the terminal type
243 (such as
244 .B \%key_home
245 .RB \%( khome )
246 or
247 .B \%key_up
248 .RB \%( kuu1 )),
249 .B \%wgetch
250 returns the function key code corresponding to the unique sequence
251 defined by the terminal.
252 .bP
253 If the escape sequence matches no function keys
254 defined for the terminal type,
255 call
256 .B \%wgetch
257 repeatedly to obtain
258 the codes of the individual characters of the sequence,
259 in the order they occurred in the input.
260 .bP
261 If
262 .B \%wgetch
263 cannot decide the validity of the input as a function key
264 because it has not read enough characters to disambiguate it,
265 the function waits until it has this information or the
266 .I "escape delay"
267 elapses.
268 Configure the escape delay
269 with the global variable
270 .BR \%ESCDELAY ","
271 an extension
272 (see section \*(``EXTENSIONS\*('' below),
273 or the environment variable of the same name
274 (see section \*(``ENVIRONMENT\*('' of \fB\%ncurses\fP(3NCURSES)),
275 also an extension.
276 .PP
277 Consequently,
278 a user of a
279 .I curses
280 application that employs keypad mode
281 may experience a pause or \*(``hang\*(''
282 after pressing the escape key while
283 .I curses
284 collects sufficient characters to disambiguate the input.
285 If the window is in \*(``no time-out\*('' mode,
286 the escape delay is effectively infinite;
287 see \fB\%notimeout\fP(3NCURSES).
288 In the event of such a pause,
289 further typing \*(``awakens\*(''
290 .IR curses "."
291 .SS "Ungetting Characters"
292 .B \%ungetch
293 places
294 .I c
295 into the input queue to be returned by the next call to
296 .BR \%wgetch "."
297 A single input queue serves all windows associated with the screen.
298 .SS "Key Codes"
299 The header file
300 .I \%curses.h
301 defines the following function key codes.
302 .bP
303 Except for the special case of
304 .BR \%KEY_RESIZE ","
305 a window's keypad mode must be enabled for
306 .B \%wgetch
307 to read these codes from it.
308 .bP
309 Not all of these are necessarily supported on any particular terminal.
310 .bP
311 The naming convention may seem obscure,
312 with some apparent misspellings
313 (such as \*(``RSUME\*('' for \*(``resume\*('');
314 the names correspond to the
315 .I \%term\%info
316 capability names for the keys,
317 and were standardized before the IBM PC/AT keyboard layout achieved a
318 dominant position in industry.
319 .PP
320 .RS
321 .\" XXX: Move this list into ncurses(3X), rather than duplicating it in
322 .\" get_wch(3X) or having that page cross reference this one?
323 .TS
324 Lb Lb
325 Lb Lw(36n)x.
326 Symbol Key name
327 =
328 KEY_BREAK Break key
329 .ne 4
330 KEY_DOWN Arrow keys
331 KEY_UP \^
332 KEY_LEFT \^
333 KEY_RIGHT \^
334 KEY_HOME Home key (upward+left arrow)
335 KEY_BACKSPACE Backspace
336 KEY_F0 T{
337 Function keys; space for 64 keys is reserved
338 T}
339 KEY_F(\fIn\fP) T{
340 Function key \fIn\fP where 0 \(<= \fIn\fP \(<= 63
341 T}
342 KEY_DL Delete line
343 KEY_IL Insert line
344 KEY_DC Delete character
345 KEY_IC Insert character/Enter insert mode
346 KEY_EIC Exit insert character mode
347 KEY_CLEAR Clear screen
348 KEY_EOS Clear to end of screen
349 KEY_EOL Clear to end of line
350 KEY_SF Scroll one line forward
351 KEY_SR Scroll one line backward (reverse)
352 KEY_NPAGE Next page/Page up
353 KEY_PPAGE Previous page/Page down
354 KEY_STAB Set tab
355 KEY_CTAB Clear tab
356 KEY_CATAB Clear all tabs
357 KEY_ENTER Enter/Send
358 KEY_SRESET Soft (partial) reset
359 KEY_RESET (Hard) reset
360 KEY_PRINT Print/Copy
361 KEY_LL Home down/Bottom (lower left)
362 KEY_A1 Upper left of keypad
363 KEY_A3 Upper right of keypad
364 KEY_B2 Center of keypad
365 KEY_C1 Lower left of keypad
366 KEY_C3 Lower right of keypad
367 KEY_BTAB Back tab key
368 KEY_BEG Beg(inning) key
369 KEY_CANCEL Cancel key
370 KEY_CLOSE Close key
371 KEY_COMMAND Cmd (command) key
372 KEY_COPY Copy key
373 KEY_CREATE Create key
374 KEY_END End key
375 KEY_EXIT Exit key
376 KEY_FIND Find key
377 KEY_HELP Help key
378 KEY_MARK Mark key
379 KEY_MESSAGE Message key
380 KEY_MOUSE Mouse event occurred
381 KEY_MOVE Move key
382 KEY_NEXT Next object key
383 KEY_OPEN Open key
384 KEY_OPTIONS Options key
385 KEY_PREVIOUS Previous object key
386 KEY_REDO Redo key
387 KEY_REFERENCE Ref(erence) key
388 KEY_REFRESH Refresh key
389 KEY_REPLACE Replace key
390 KEY_RESIZE Screen resized
391 KEY_RESTART Restart key
392 KEY_RESUME Resume key
393 KEY_SAVE Save key
394 KEY_SELECT Select key
395 KEY_SUSPEND Suspend key
396 KEY_UNDO Undo key
397 _
398 KEY_SBEG Shifted beginning key
399 KEY_SCANCEL Shifted cancel key
400 KEY_SCOMMAND Shifted command key
401 KEY_SCOPY Shifted copy key
402 KEY_SCREATE Shifted create key
403 KEY_SDC Shifted delete character key
404 KEY_SDL Shifted delete line key
405 KEY_SEND Shifted end key
406 KEY_SEOL Shifted clear line key
407 KEY_SEXIT Shifted exit key
408 KEY_SFIND Shifted find key
409 KEY_SHELP Shifted help key
410 KEY_SHOME Shifted home key
411 KEY_SIC Shifted insert key
412 KEY_SLEFT Shifted left arrow key
413 KEY_SMESSAGE Shifted message key
414 KEY_SMOVE Shifted move key
415 KEY_SNEXT Shifted next object key
416 KEY_SOPTIONS Shifted options key
417 KEY_SPREVIOUS Shifted previous object key
418 KEY_SPRINT Shifted print key
419 KEY_SREDO Shifted redo key
420 KEY_SREPLACE Shifted replace key
421 KEY_SRIGHT Shifted right arrow key
422 KEY_SRSUME Shifted resume key
423 KEY_SSAVE Shifted save key
424 KEY_SSUSPEND Shifted suspend key
425 KEY_SUNDO Shifted undo key
426 .TE
427 .RE
428 .PP
429 Many keyboards feature a nine-key directional pad.
430 .PP
431 .RS
432 .TS
433 allbox center;
434 C C C.
435 A1 up A3
436 left B2 right
437 C1 down C3
438 .TE
439 .RE
440 .sp
441 Two of the symbols in the list above do
442 .I not
443 correspond to a physical key.
444 .bP
445 .B \%wgetch
446 returns
447 .BR \%KEY_RESIZE ","
448 even if the window's keypad mode is disabled,
449 if
450 .I \%ncurses
451 has handled a
452 .I \%SIGWINCH
453 signal since
454 .B \%wgetch
455 was called;
456 see \fB\%initscr\fP(3NCURSES) and \fB\%resizeterm\fP(3NCURSES).
457 .bP
458 .B \%wgetch
459 returns
460 .B \%KEY_MOUSE
461 to indicate that a mouse event is pending collection;
462 see \fB\%mouse\fP(3NCURSES).
463 Receipt of this code requires a window's keypad mode to be enabled,
464 because to interpret mouse input
465 (as with \fI\%xterm\fP(1)'s mouse protocol),
466 .I \%ncurses
467 must read an escape sequence,
468 as with a function key.
469 .SS "Testing Key Codes"
470 In
471 .IR \%ncurses ","
472 .B \%has_key
473 returns a Boolean value indicating whether the terminal type recognizes
474 its parameter as a key code value.
475 See also
476 \fB\%define_key\fP(3NCURSES) and \fB\%key_defined\fP(3NCURSES).
477 .SH RETURN VALUE
478 .B \%wgetch
479 returns a key code identifying the key event as described above,
480 which may include
481 .B \%KEY_RESIZE
482 or
483 .B \%KEY_MOUSE
484 indicating non-key events,
485 or
486 .B ERR
487 on failure.
488 .B \%wgetch
489 fails if
490 its timeout expires without any data arriving,
491 which cannot happen if \fB\%nodelay\fP(3NCURSES) is in effect on the window.
492 .PP
493 In
494 .IR \%ncurses ,
495 .B \%wgetch
496 also fails if
497 .bP
498 the
499 .I curses
500 screen has not been initialized,
501 .bP
502 (for functions taking a
503 .I \%WINDOW
504 pointer argument)
505 .I win
506 is a null pointer,
507 .bP
508 the terminal input stream is closed,
509 in which case
510 .I \%errno
511 is set to
512 .IR \%EBADF ","
513 or
514 .bP
515 execution was interrupted by a signal,
516 in which case
517 .I \%errno
518 is set to
519 .IR \%EINTR "."
520 .PP
521 Functions prefixed with \*(``mv\*('' first perform cursor movement and
522 fail if the position
523 .RI ( y ,
524 .IR x ")"
525 is outside the window boundaries.
526 .PP
527 .B \%ungetch
528 returns
529 .B OK
530 on success and
531 .B ERR
532 on failure.
533 In
534 .IR \%ncurses ,
535 .B \%ungetch
536 fails if
537 .bP
538 the
539 .I curses
540 screen has not been initialized,
541 or
542 .bP
543 there is no more room in the input queue.
544 .PP
545 .B \%has_key
546 returns
547 .B TRUE
548 or
549 .BR FALSE "."
550 .SH NOTES
551 .BR \%getch ","
552 .BR \%mvgetch ","
553 and
554 .B \%mvwgetch
555 may be implemented as macros.
556 .PP
557 .I curses
558 discourages assignment of the ESC key to a discrete function by the
559 programmer because the library requires a delay while it awaits the
560 potential remainder of a terminal escape sequence.
561 .PP
562 Some key strokes are indistinguishable from control characters;
563 for example,
564 .B \%KEY_ENTER
565 may be the same as
566 .BR \*^M ","
567 .\" as with att630 or pccon+keys
568 and
569 .B \%KEY_BACKSPACE
570 may be the same as
571 .B \*^H
572 .\" as with att505 or vt52-basic
573 or
574 .BR \*^? "."
575 .\" as with pccon+keys or vt320
576 Consult the
577 .I \%term\%info
578 entry for the terminal type to determine whether this is the case;
579 see \fB\%infocmp\fP(1).
580 Some
581 .I curses
582 implementations,
583 including
584 .IR \%ncurses ","
585 honor the
586 .I \%term\%info
587 key definitions;
588 others treat such control characters specially.
589 .PP
590 .I curses
591 distinguishes the Enter keys in the alphabetic and numeric keypad
592 sections of a keyboard because (most) terminals do.
593 .B \%KEY_ENTER
594 refers to the key on the numeric keypad and,
595 like other function keys,
596 is reliably recognized only if the window's keypad mode is enabled.
597 .bP
598 The
599 .I \%term\%info
600 .B \%key_enter
601 .RB ( kent )
602 capability describes the character (sequence) sent by the Enter key of
603 a terminal's numeric
604 (or similar)
605 keypad.
606 .bP
607 \*(``Enter or send\*('' is X/Open Curses's description of this key.
608 .PP
609 .I curses
610 treats the Enter or Return key in the
611 .I alphabetic
612 section of the keyboard differently.
613 .bP
614 It usually produces a control code for carriage return
615 .RB ( \*^M )
616 or line feed
617 .RB ( \*^J ).
618 .bP
619 Depending on the terminal mode
620 (raw,
621 cbreak,
622 or
623 canonical),
624 and whether \fB\%nl\fP(3NCURSES) or \fB\%nonl\fP(3NCURSES) has been called,
625 .B \%wgetch
626 may return either a carriage return or line feed upon an Enter or Return
627 key stroke.
628 .PP
629 Use of
630 .B \%wgetch
631 with \fB\%echo\fP(3NCURSES) and neither \fB\%cbreak\fP(3NCURSES) nor \fB\%raw\fP(3NCURSES)
632 is not well-defined.
633 .PP
634 Historically,
635 the list of key code macros above was influenced by the keyboard of the
636 AT&T 7300
637 (also known variously as the \*(``3B1\*('', \*(``Safari 4\*('', and
638 \*(``UNIX PC\*(''),
639 a 1985 machine rich in function keys.
640 Today's computer keyboards are based on that of the IBM PC/AT
641 and tend to have fewer.
642 A
643 .I curses
644 application can expect such a keyboard to transmit key codes
645 .BR \%KEY_UP ","
646 .BR \%KEY_DOWN ","
647 .BR \%KEY_LEFT ","
648 .BR \%KEY_RIGHT ","
649 .BR \%KEY_HOME ","
650 .BR \%KEY_END ","
651 .B \%KEY_PPAGE
652 (Page Up),
653 .B \%KEY_NPAGE
654 (Page Down),
655 .B \%KEY_IC
656 (Insert),
657 .B \%KEY_DC
658 (Delete),
659 .BR \%KEY_A1 ","
660 .BR \%KEY_A3 ","
661 .BR \%KEY_B2 ","
662 .BR \%KEY_C1 ","
663 .BR \%KEY_C3 ","
664 and
665 .BI \%KEY_F( n )
666 for 1 \(<=
667 .I n
668 \(<= 12.
669 .\" Other numeric keypad keys from the DEC VT220 (specifically, the
670 .\" LK201 commonly used with it) and IBM PC/AT keyboards -- the comma
671 .\" (DEC); plus, star, and slash (PC); and zero, dot, and minus (both)
672 .\" have no standard key capability codes.
673 .SH EXTENSIONS
674 In
675 .IR \%ncurses ","
676 when a window's \*(``no time-out\*('' mode is
677 .I not
678 set,
679 the
680 .B \%ESCDELAY
681 variable configures the duration of the timer used to disambiguate a
682 function key character sequence from a series of key strokes beginning
683 with ESC typed by the user;
684 see
685 \fB\%curses_variables\fP(3NCURSES).
686 .PP
687 .B \%has_key
688 is an
689 .I \%ncurses
690 extension,
691 and is not found in SVr4
692 .IR curses ","
693 4.4BSD
694 .IR curses ","
695 or any other previous
696 .I curses
697 implementation.
698 .SH PORTABILITY
699 Applications employing
700 .I \%ncurses
701 extensions should condition their use on the visibility of the
702 .B \%NCURSES_VERSION
703 preprocessor macro.
704 .PP
705 Except as noted in section \*(``EXTENSIONS\*('' above,
706 X/Open Curses Issue\ 4 describes these functions.
707 It specifies no error conditions for them.
708 .PP
709 SVr4 describes a successful return value only as
710 \*(``an integer value other than
711 .IR ERR \*(''. \" Courier roman in source; SVID 4, vol. 3, p. 494
712 .PP
713 .I \%wgetch
714 reads only single-byte characters.
715 .PP
716 The echo behavior of these functions on input of
717 .I KEY_
718 or backspace characters is not documented in SVr4
719 .IR curses "."
720 .PP
721 The behavior of
722 .I \%wgetch
723 in the presence of signal handlers is not documented in SVr4
724 .I curses
725 and is unspecified by X/Open Curses.
726 In historical
727 .I curses
728 implementations,
729 it varied depending on whether the operating system's dispatch of a
730 signal to a handler interrupted a \fIread\fP(2) call in progress,
731 and also
732 (in some implementations)
733 whether an input timeout or non-blocking mode had been set.
734 A portable
735 .I curses
736 application prepares for two cases:
737 (a) signal receipt does not interrupt
738 .IR \%wgetch ";"
739 and
740 (b) signal receipt interrupts
741 .I \%wgetch
742 and causes it to return
743 .I ERR
744 with
745 .I \%errno
746 set to
747 .IR \%EINTR "."
748 .PP
749 .I \%KEY_MOUSE
750 is mentioned in X/Open Curses,
751 along with a few related
752 .I \%term\%info
753 capabilities,
754 but no higher-level functions use the feature.
755 The implementation in
756 .I \%ncurses
757 is an extension.
758 .PP
759 .I \%KEY_RESIZE
760 and
761 .I \%has_key
762 are extensions first implemented for
763 .IR \%ncurses "."
764 By 2022,
765 .I \%PDCurses
766 .\" https://web.archive.org/web/20220117232009/https://pdcurses.org/docs/MANUAL.html
767 and
768 NetBSD
769 .I curses
770 .\" https://web.archive.org/web/20200923185647/https://man.netbsd.org/curses_input.3
771 had added them along with
772 .IR \%KEY_MOUSE "."
773 .SH HISTORY
774 4BSD (1980)
775 introduced
776 .I \%wgetch
777 and its variants.
778 .PP
779 SVr3 (1987)
780 added
781 .IR \%ungetch "."
782 .PP
783 .I \%ncurses
784 1.9.9g (1996)
785 furnished the
786 .I \%has_key
787 extension.
788 .SH SEE ALSO
789 ECMA-6 \*(``7-bit coded Character Set\*(''
790 \%<https://\*:ecma\-international\*:.org/\
791 \*:publications\-and\-standards/\*:standards/\*:ecma\-6/>
792 .PP
793 ECMA-48 \*(``Control Functions for Coded Character Sets\*(''
794 \%<https://\*:ecma\-international\*:.org/\
795 \*:publications\-and\-standards/\*:standards/\*:ecma\-48/>
796 .PP
797 \fB\%get_wch\fP(3NCURSES) describes comparable functions of the
798 .I \%ncurses
799 library in its wide-character configuration
800 .RI \%( ncursesw ).
801 .PP
802 \fB\%ncurses\fP(3NCURSES),
803 \fB\%addch\fP(3NCURSES),
804 \fB\%inopts\fP(3NCURSES),
805 \fB\%mouse\fP(3NCURSES),
806 \fB\%move\fP(3NCURSES),
807 \fB\%outopts\fP(3NCURSES),
808 \fB\%refresh\fP(3NCURSES),
809 \fB\%curses_variables\fP(3NCURSES),
810 \fB\%resizeterm\fP(3NCURSES),
811 \fB\%ascii\fP(7)