keybound(3X) Library calls keybound(3X)

# [NAME](#NAME)

**keybound** - get definition of a *curses* function key code

# [SYNOPSIS](#SYNOPSIS)

```
#include <curses.h>
```

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

# [DESCRIPTION](#DESCRIPTION)

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)](/man/os/ncurses/wgetch.3X) (wide-character API users: [**wget\_wch**(3X)](/man/os/ncurses/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)](/man/os/ncurses/define_key.3X), as if by pushing new definitions onto a stack. The *count* parameter accesses the *n*th most recently defined binding; **0** selects the binding that is used on input.

# [RETURN VALUE](#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](#EXTENSIONS)

**keybound** is an *ncurses* extension.

# [PORTABILITY](#PORTABILITY)

Applications employing *ncurses* extensions should condition their use on the visibility of the **NCURSES\_VERSION** preprocessor macro.

# [AUTHORS](#AUTHORS)

Thomas Dickey

# [SEE ALSO](#SEE_ALSO)

[**curses**(3X)](/man/os/ncurses/curses.3X), [**define\_key**(3X)](/man/os/ncurses/define_key.3X), [**keyok**(3X)](/man/os/ncurses/keyok.3X), [**key\_defined**(3X)](/man/os/ncurses/key_defined.3X), [**terminfo**(5)](/man/os/ncurses/terminfo.5)

2024-12-28 ncurses 6.6

---

Document: keybound(3x) from ncurses 6.6.20261010-r0 (Chainguard OS)
Source: https://github.com/ThomasDickey/ncurses-snapshots
