X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=man%2Fkeyok.3x;h=d31d5b1f4fe14c4a5df58da23a596010a025e4e1;hb=HEAD;hp=e3f2287abb13ff8b920f4d02aa3c44e88a168699;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01;p=ncurses.git diff --git a/man/keyok.3x b/man/keyok.3x index e3f2287a..d4b94ac3 100644 --- a/man/keyok.3x +++ b/man/keyok.3x @@ -1,5 +1,6 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * +.\" Copyright 2018-2023,2024 Thomas E. Dickey * +.\" Copyright 1998-2010,2017 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,38 +27,85 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" Author: Thomas E. Dickey 1997 +.\" Author: Thomas E. Dickey 1997 .\" -.\" $Id: keyok.3x,v 1.7 2002/02/16 22:40:59 tom Exp $ -.TH keyok 3X "" +.\" $Id: keyok.3x,v 1.46 2024/06/15 19:49:39 tom Exp $ +.TH keyok 3X 2024-06-15 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls" +. +.de bP +.ie n .IP \(bu 4 +.el .IP \(bu 2 +.. +. .SH NAME -\fBkeyok\fP \- enable or disable a keycode +\fB\%keyok\fP \- +enable or disable a \fIcurses\fP function key code .SH SYNOPSIS -\fB#include \fP - -\fBint keyok(int keycode, bool enable);\fP +.nf +\fB#include +.PP +\fBint keyok(int \fIkey-code\fP, bool \fIbf\fP); +.fi .SH DESCRIPTION -This is an extension to the curses library. -It permits an application to disable specific keycodes, rather than -use the \fIkeypad\fP function to disable all keycodes. -Keys that have been disabled can be reenabled. +The +.B \%keyok +.I \%ncurses +extension permits a +.I curses +application to disable a function key +.I key-code +returned by \fB\%wgetch\fP(3X) +(wide-character API users: +\fB\%wget_wch\fP(3X)). +Key codes that have been disabled can be re-enabled. +.I bf +indicates the desired enablement status. +This operation is more fine-grained than calling \fB\%keypad\fP(3X), +which affects +.I all +function keys. .SH RETURN VALUE -The keycode must be greater than zero, else ERR is returned. -If it does not correspond to a defined key, then ERR is returned. -If the \fIenable\fP parameter is true, then the key must have been disabled, -and vice versa. -Otherwise, the function returns OK. +.B \%keyok +returns +.B ERR +if +.bP +.I key-code +is nonpositive, +.bP +.I key-code +is not a recognized value, +or +.bP +enablement of +.I key-code +is already in the desired state. +.PP +Otherwise, +.B \%keyok +returns +.BR OK "." +.SH EXTENSIONS +.B \%keyok +is an +.I \%ncurses +extension. .SH PORTABILITY -These routines are specific to ncurses. They were not supported on -Version 7, BSD or System V implementations. It is recommended that -any code depending on them be conditioned using NCURSES_VERSION. +Applications employing +.I \%ncurses +extensions should condition their use on the visibility of the +.B \%NCURSES_VERSION +preprocessor macro. +.PP +NetBSD +.I curses +since 2.0 (2004) supports +.BR \%keyok "." +.SH AUTHORS +Thomas Dickey .SH SEE ALSO -\fBdefine_key\fR(3X). -.SH AUTHOR -Thomas Dickey. -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: +\fB\%curses\fP(3X), +\fB\%define_key\fP(3X), +\fB\%keybound\fP(3X), +\fB\%keyok\fP(3X), +\fB\%key_defined\fP(3X)