[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/11] man/keyok.3x: Revise.
From: |
G. Branden Robinson |
Subject: |
[PATCH 07/11] man/keyok.3x: Revise. |
Date: |
Sat, 18 May 2024 11:02:24 -0500 |
Content:
* Clarify synopsis: only the key codes of _function keys_ are affected.
* Add "EXTENSIONS" section, since this function is one.
* Document portability to NetBSD curses.
* Expand cross references to cover the other ncurses key binding
extension functions, and the main ncurses page.
Style:
* Use terminology more consistently, speaking of key "bindings" and of
"function keys" (in the curses sense) rather than "keys" in general.
* Spell "key code" thus, as two words. Hyphenate it when used as a
formal argument name.
* Recast.
* Favor active voice over passive.
Markup:
* Define and use page-local `bP` macro for bulleted paragraphs.
* Favor man(7) font style macros over *roff font selection escape
sequences, except for man page cross references (because
man/make_sed.sh recognizes only certain patterns when rewriting such
cross references) and terms in the "NAME" section (because the
generated edit_man.sh script expects font selection escape sequences
when scraping terms from there to gather names for man page aliases).
* Break input lines after commas.
* Use font selection escape sequences more idiomatically; employ `\fP`
to return to the previous font in summary description, not `\fR` to
select roman.
---
man/keyok.3x | 82 +++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 65 insertions(+), 17 deletions(-)
diff --git a/man/keyok.3x b/man/keyok.3x
index b4c7de2b4..7bf3fa469 100644
--- a/man/keyok.3x
+++ b/man/keyok.3x
@@ -31,33 +31,81 @@
.\"
.\" $Id: keyok.3x,v 1.40 2024/03/16 15:35:01 tom Exp $
.TH keyok 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library
calls"
+.
+.de bP
+.ie n .IP \(bu 4
+.el .IP \(bu 2
+..
+.
.SH NAME
\fB\%keyok\fP \-
-enable or disable a \fIcurses\fR keycode
+enable or disable a \fIcurses\fP function key code
.SH SYNOPSIS
.nf
\fB#include <curses.h>
.PP
-\fBint keyok(int \fIkeycode\fP, bool \fIenable\fP);
+\fBint keyok(int \fIkey-code\fP, bool \fIbf\fP);
.fi
.SH DESCRIPTION
-This is an extension to the \fIcurses\fP library.
-It permits an application to disable specific keycodes, rather than
-use the \fB\%keypad\fP function to disable all keycodes.
-Keys that have been disabled can be re-enabled.
+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 \fBERR\fP is returned.
-If it does not correspond to a defined key, then \fBERR\fP is returned.
-If the \fIenable\fP parameter is true, then the key must have been disabled,
-and vice versa.
-Otherwise, the function returns \fBOK\fP.
+.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
-This routine is specific to \fI\%ncurses\fP.
-It was not supported on
-Version 7, BSD or System V implementations.
-It is recommended that
-any code depending on them be conditioned using \fB\%NCURSES_VERSION\fP.
+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
-\fB\%define_key\fP(3X)
+\fB\%ncurses\fP(3X),
+\fB\%define_key\fP(3X),
+\fB\%key_defined\fP(3X),
+\fB\%keybound\fP(3X),
+\fB\%keyok\fP(3X),
--
2.30.2
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 07/11] man/keyok.3x: Revise.,
G. Branden Robinson <=