]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_get_wch.3x
ncurses 6.2 - patch 20201003
[ncurses.git] / man / curs_get_wch.3x
index 26ff2d4c436a08a3d21ca26df17dd701b5c4e329..4a30cf1670c975a9bcd68a7279534490b7b440e4 100644 (file)
@@ -1,5 +1,6 @@
 .\"***************************************************************************
 .\"***************************************************************************
-.\" Copyright (c) 2002 Free Software Foundation, Inc.                        *
+.\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
+.\" Copyright 2002-2016,2017 Free Software Foundation, Inc.                  *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_get_wch.3x,v 1.3 2002/05/18 21:48:53 tom Exp $
+.\" $Id: curs_get_wch.3x,v 1.13 2020/02/02 23:34:34 tom Exp $
 .TH curs_get_wch 3X ""
 .TH curs_get_wch 3X ""
+.na
+.hy 0
+.ie \n(.g .ds `` \(lq
+.el       .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el       .ds '' ''
+.de bP
+.ie n  .IP \(bu 4
+.el    .IP \(bu 2
+..
 .SH NAME
 \fBget_wch\fR,
 \fBwget_wch\fR,
 \fBmvget_wch\fR,
 \fBmvwget_wch\fR,
 \fBunget_wch\fR \- get (or push back) a wide character from curses terminal keyboard
 .SH NAME
 \fBget_wch\fR,
 \fBwget_wch\fR,
 \fBmvget_wch\fR,
 \fBmvwget_wch\fR,
 \fBunget_wch\fR \- get (or push back) a wide character from curses terminal keyboard
+.ad
+.hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
-\fBint get_wch(win_t *\fR\fIwch\fR\fB);\fR
+\fBint get_wch(wint_t *\fR\fIwch\fR\fB);\fR
 .br
 .br
-\fBint wget_wch(WINDOW *\fR\fIwin\fR\fB, win_t *\fR\fIwch\fR\fB);\fR
+\fBint wget_wch(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwch\fR\fB);\fR
 .br
 .br
-\fBint mvget_wch(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, win_t *\fR\fIwch\fR\fB);\fR
+\fBint mvget_wch(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwch\fR\fB);\fR
 .br
 .br
-\fBint mvwget_wch(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, win_t *\fR\fIwch\fR\fB);\fR
+\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
 .br
 \fBint unget_wch(const wchar_t \fR\fIwch\fR\fB);\fR
 .SH DESCRIPTION
 .br
 \fBint unget_wch(const wchar_t \fR\fIwch\fR\fB);\fR
 .SH DESCRIPTION
@@ -64,25 +77,20 @@ or after the first newline (nocbreak mode).
 In half-delay mode,
 the program waits until the user types a character or the specified
 timeout interval has elapsed.
 In half-delay mode,
 the program waits until the user types a character or the specified
 timeout interval has elapsed.
-
+.PP
 Unless \fBnoecho\fR has been set,
 these routines echo the character into the designated window.
 Unless \fBnoecho\fR has been set,
 these routines echo the character into the designated window.
-
+.PP
 If the window is not a pad and has been moved or modified since the
 last call to \fBwrefresh\fR,
 \fBwrefresh\fR will be called before another character is read.
 If the window is not a pad and has been moved or modified since the
 last call to \fBwrefresh\fR,
 \fBwrefresh\fR will be called before another character is read.
-
+.PP
 If \fBkeypad\fR is enabled,
 these functions respond to
 the pressing of a function key by setting the object pointed to by
 \fIwch\fR
 If \fBkeypad\fR is enabled,
 these functions respond to
 the pressing of a function key by setting the object pointed to by
 \fIwch\fR
-to the corresponding
-\fBKEY_\fR
-value defined
-in
-\fB<curses.h>\fR
-and returning
-\fBKEY_CODE_YES\fR.
+to the keycode assigned to the function key,
+and returning \fBKEY_CODE_YES\fR.
 If a character (such as escape) that could be the
 beginning of a function key is received, curses sets a timer.
 If the remainder
 If a character (such as escape) that could be the
 beginning of a function key is received, curses sets a timer.
 If the remainder
@@ -92,6 +100,18 @@ For this
 reason, many terminals experience a delay between the time a user presses
 the escape key and the time the escape is returned to the program.
 .PP
 reason, many terminals experience a delay between the time a user presses
 the escape key and the time the escape is returned to the program.
 .PP
+The keycodes returned by these functions are the same as those
+returned by \fBwgetch\fP:
+.bP
+The predefined function
+keys are listed in \fB<curses.h>\fR as macros with values outside the range
+of 8-bit characters.
+Their names begin with \fBKEY_\fR.
+.bP
+Other (user-defined) function keys
+which may be defined using \fBdefine_key\fP(3X) have no names,
+but also are expected to have values outside the range of 8-bit characters.
+.PP
 The
 \fBunget_wch\fR
 function pushes the wide character
 The
 \fBunget_wch\fR
 function pushes the wide character
@@ -130,9 +150,9 @@ at the same time.
 Depending on the state of the tty driver when each character
 is typed, the program may produce undesirable results.
 .PP
 Depending on the state of the tty driver when each character
 is typed, the program may produce undesirable results.
 .PP
-All functions except \fBwget_wch\fR and \fBunget_wch\fR 
+All functions except \fBwget_wch\fR and \fBunget_wch\fR
 may be macros.
 may be macros.
-.SH RETURN VALUES
+.SH RETURN VALUE
 When
 \fBget_wch\fR,
 \fBwget_wch\fR,
 When
 \fBget_wch\fR,
 \fBwget_wch\fR,
@@ -152,6 +172,10 @@ returns
 \fBOK\fR.
 Otherwise, the function returns
 \fBERR\fR.
 \fBOK\fR.
 Otherwise, the function returns
 \fBERR\fR.
+.PP
+Functions with a \*(``mv\*('' prefix first perform a cursor movement using
+\fBwmove\fP, and return an error if the position is outside the window,
+or if the window pointer is null.
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_getch\fR(3X),
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_getch\fR(3X),