key_defined(3x) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | EXTENSIONS | PORTABILITY | AUTHORS | SEE ALSO | COLOPHON

key_defined(3X)               Library calls               key_defined(3X)

NAME         top

       key_defined - obtain key code for an ncurses function key
       definition

SYNOPSIS         top

       #include <curses.h>

       int key_defined(const char * definition);

DESCRIPTION         top

       The key_defined ncurses extension permits a curses application to
       determine the function key code, if any, to which the string
       definition is bound.

RETURN VALUE         top

       key_defined returns the first key code to which definition is
       bound if any exists.  If none does, it returns 0.  If definition
       is a prefix of another bound definition, key_defined returns -1.

EXTENSIONS         top

       key_defined is an ncurses extension.

PORTABILITY         top

       Applications employing ncurses extensions should condition their
       use on the visibility of the NCURSES_VERSION preprocessor macro.

AUTHORS         top

       Thomas Dickey

SEE ALSO         top

       curses(3X), define_key(3X), keybound(3X), keyok(3X)

COLOPHON         top

       This page is part of the ncurses (new curses) project.
       Information about the project can be found at 
       ⟨https://invisible-island.net/ncurses/ncurses.html⟩.  If you have a
       bug report for this manual page, send it to bug-ncurses@gnu.org.
       This page was obtained from the tarball ncurses-6.6.tar.gz fetched
       from ⟨https://ftp.gnu.org/gnu/ncurses/⟩ on 2026-01-16.  If you
       discover any rendering problems in this HTML version of the page,
       or you believe there is a better or more up-to-date source for the
       page, or you have corrections or improvements to the information
       in this COLOPHON (which is not part of the original manual page),
       send a mail to man-pages@man7.org

ncurses @NCURSES_MAJOR@.@NCU... 2025-10-04                key_defined(3X)