keyok - enable or disable a curses function key code
Contents
Description
The keyokncurses extension permits a curses application to disable a function key key-code returned by
wgetch(3NCURSES) (wide-character API users: wget_wch(3NCURSES)). 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(3NCURSES), which affects all function keys.
Extensions
keyok is an ncurses extension.
Name
keyok - enable or disable a curses function key code
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.
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.
See Also
ncurses(3NCURSES), define_key(3NCURSES), keybound(3NCURSES), keyok(3NCURSES), key_defined(3NCURSES) ncurses 6.5 2024-07-27 keyok(3NCURSES)
Synopsis
#include<curses.h>intkeyok(intkey-code,boolbf);
