keyok(3)

keyok3

Enable or disable an ncurses function key code

Usage

#include <curses.h>

int keyok(int key-code, bool bf);

Overview

The keyok ncurses extension permits a curses application to disable a function key key-code returned by wgetch(3X) (wide-character API users: wget_wch(3X)). Key codes that have been disabled can be re-enabled. bf selects the desired enablement status. This operation is more fine-grained than calling keypad(3X), which affects all function keys.

Return value

keyok returns ERR if

•

key-code is nonpositive,

•

key-code is not a recognized value, or

•

enablement of key-code is already in the desired state.

Otherwise, keyok returns OK.

Extensions

keyok is an ncurses extension.

Portability

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

NetBSD curses since 2.0 (2004) supports keyok.

Releases

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

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