keybound(3)

keybound3

Get definition of a curses function key code

Usage

#include <curses.h>

char * keybound(int key-code, int count);

Overview

The keybound ncurses extension permits a curses application to obtain the value of the string bound to the function key key-code; see wgetch(3X) (wide-character API users: wget_wch(3X)). By default, such bindings are string capabilities from the terminfo database entry corresponding to the terminal type. The application can non-destructively and repeatedly override such definitions with define_key(3X), as if by pushing new definitions onto a stack. The count parameter accesses the nth most recently defined binding; 0 selects the binding that is used on input.

Return value

If key-code corresponds to a function key defined by the application or the terminal type in use, keybound allocates and returns a string that must be freed by the application. keybound returns NULL if key-code is not positive or if it does not correspond to a key code definition.

Extensions

keybound is an ncurses extension.

Portability

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

Releases

70 releases since FreeBSD 4.0-RELEASE; the text changed 12 times.

  1. 4.0–4.11
  2. 5.0–6.2
  3. 6.3–7.3
  4. 7.4
  5. 8.0–8.1
  6. 8.2–10.4
  7. 11.0–12.4
  8. 13.0–13.5
  9. 14.0–14.1
  10. 14.2–14.4
  11. 14.5
  12. 15.0
  13. 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.