DOKK / manpages / debian 13 / ncurses-doc / key_defined.3ncurses.en
key_defined(3NCURSES) Library calls key_defined(3NCURSES)

key_defined - test whether a curses function key code is defined

#include <curses.h>
int key_defined(const char * definition);

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

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 binding, key_defined returns -1.

define_key is an ncurses extension.

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

Thomas Dickey

ncurses(3NCURSES), define_key(3NCURSES), keybound(3NCURSES), keyok(3NCURSES)

2024-06-08 ncurses 6.5