key_defined(3)

key_defined3

Obtain key code for an ncurses function key definition

Usage

#include <curses.h>

int key_defined(const char * definition);

Overview

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

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

key_defined is an ncurses extension.

Portability

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

Releases

46 releases since FreeBSD 6.3-RELEASE; the text changed 7 times.

  1. 6.3–10.4
  2. 11.0–12.4
  3. 13.0–13.5
  4. 14.0–14.1
  5. 14.2–14.4
  6. 14.5
  7. 15.0
  8. 15.1–16.0

Authors

Thomas Dickey

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's man source.