Debian Codegraph @

upstream/debian-unstable/man3/key_defined.3ncurses

raw
1 .\"***************************************************************************
2 .\" Copyright 2018-2024,2025 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.44 2025/10/04 20:11:22 tom Exp $
33 .TH key_defined 3NCURSES 2025-10-04 "ncurses 6.6" "Library calls"
34 .SH NAME
35 \fB\%key_defined\fP \-
36 obtain key code for an \fIncurses\fP function key definition
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 bound definition,
65 .B \%key_defined
66 returns
67 .BR \-1 "."
68 .SH EXTENSIONS
69 .B \%key_defined
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(3NCURSES),
83 \fB\%define_key\fP(3NCURSES),
84 \fB\%keybound\fP(3NCURSES),
85 \fB\%keyok\fP(3NCURSES)