]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/key_defined.3x
ncurses 6.5 - patch 20240518
[ncurses.git] / man / key_defined.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2023,2024 Thomas E. Dickey                                *
3 .\" Copyright 2003-2006,2010 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" Author: Thomas E. Dickey 2003
31 .\"
32 .\" $Id: key_defined.3x,v 1.36 2024/05/18 20:04:53 tom Exp $
33 .TH key_defined 3X 2024-05-18 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
34 .SH NAME
35 \fB\%key_defined\fP \-
36 test whether a \fIcurses\fP function key code is defined
37 .SH SYNOPSIS
38 .nf
39 \fB#include <curses.h>
40 .PP
41 \fBint key_defined(const char * \fIdefinition\fP);
42 .fi
43 .SH DESCRIPTION
44 The
45 .B \%key_defined
46 .I \%ncurses
47 extension permits a
48 .I curses
49 application to determine the function key code,
50 if any,
51 to which the string
52 .I definition
53 is bound.
54 .SH RETURN VALUE
55 .B \%key_defined
56 returns the first key code to which
57 .I definition
58 is bound if any exists.
59 If none does,
60 it returns
61 .BR 0 "."
62 If
63 .I definition
64 is a prefix of another binding,
65 .B \%key_defined
66 returns
67 .BR \-1 "."
68 .SH EXTENSIONS
69 .B \%define_key
70 is an
71 .I \%ncurses
72 extension.
73 .SH PORTABILITY
74 Applications employing
75 .I \%ncurses
76 extensions should condition their use on the visibility of the
77 .B \%NCURSES_VERSION
78 preprocessor macro.
79 .SH AUTHORS
80 Thomas Dickey
81 .SH SEE ALSO
82 \fB\%ncurses\fP(3X),
83 \fB\%define_key\fP(3X),
84 \fB\%keyok\fP(3X),
85 \fB\%keybound\fP(3X),
86 \fB\%keyok\fP(3X)