keybound(3ncurses)

keybound3ncurses

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(3NCURSES) (wide-character API users: wget_wch(3NCURSES)). 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(3NCURSES), 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

13 releases since Debian 2.2 (Potato); the text changed 9 times.

  1. 2.2
  2. 3.0
  3. 3.1
  4. 4.0
  5. 5.0–6.0
  6. 7–9
  7. 10
  8. 11
  9. 12
  10. 13

Authors

Thomas Dickey

From ncurses-doc 6.5+20250216-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.