keyok(3x) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | EXTENSIONS | PORTABILITY | AUTHORS | SEE ALSO | COLOPHON

keyok(3X)                     Library calls                     keyok(3X)

NAME         top

       keyok - enable or disable an ncurses function key code

SYNOPSIS         top

       #include <curses.h>

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

DESCRIPTION         top

       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         top

       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         top

       keyok is an ncurses extension.

PORTABILITY         top

       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.

AUTHORS         top

       Thomas Dickey

SEE ALSO         top

       curses(3X), define_key(3X), keybound(3X), keyok(3X),
       key_defined(3X)

COLOPHON         top

       This page is part of the ncurses (new curses) project.
       Information about the project can be found at 
       ⟨https://invisible-island.net/ncurses/ncurses.html⟩.  If you have a
       bug report for this manual page, send it to bug-ncurses@gnu.org.
       This page was obtained from the tarball ncurses-6.6.tar.gz fetched
       from ⟨https://ftp.gnu.org/gnu/ncurses/⟩ on 2026-01-16.  If you
       discover any rendering problems in this HTML version of the page,
       or you believe there is a better or more up-to-date source for the
       page, or you have corrections or improvements to the information
       in this COLOPHON (which is not part of the original manual page),
       send a mail to man-pages@man7.org

ncurses @NCURSES_MAJOR@.@NCU... 2025-10-04                      keyok(3X)