summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pcvt/keycap/keycap.3
blob: 07fde95efd01d508caa0210852ee748534b5f052 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
.\"
.\" Copyright (c) 1992,1993,1994 Hellmuth Michaelis
.\"
.\" Copyright (c) 1990 The Regents of the University of California.
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)keycap.3, 3.00, Last Edit-Date: [Sun Jan  2 13:46:43 1994]
.\" $FreeBSD$
.\"
.Dd January 3, 1993
.Dt KEYCAP 3
.Sh NAME
.Nm kgetent ,
.Nm kgetnum ,
.Nm kgetflag ,
.Nm kgetstr
.Nd routines for accessing the keycap database
.Sh SYNOPSIS
.Ft int
.Fn kgetent "char *bp" "char *name"
.Ft int
.Fn kgetnum "char *id"
.Ft int
.Fn kgetflag "char *id"
.Ft char *
.Fn kgetstr "char *id" "char *area"
.Sh DESCRIPTION
These functions extract and use capabilities from a keyboard capability data
base, usually
.Pa /usr/share/misc/keycap.pcvt ,
the format of which is described in
.Xr keycap 5 .
.Pp
The
.Fn kgetent
function
extracts the entry for keyboard mapping
.Fa name
into the buffer at
.Fa bp .
The
.Fa bp
argument
should be a character buffer of size
1024 and must be retained through all subsequent calls to
.Fn kgetnum ,
.Fn kgetflag ,
and
.Fn kgetstr .
The
.Fn kgetent
function
returns \-1 if none of the
.Nm keycap
data base files could be opened,
0 if the map name given does not have an entry,
and 1 if all goes well.
.Pp
The
.Fn kgetnum
function
gets the numeric value of capability
.Fa id ,
returning \-1 if is not given for the map.
.Pp
The
.Fn kgetflag
function
returns 1 if the specified capability is present in
the map's entry, 0 if it is not.
.Pp
The
.Fn kgetstr
function
returns the string value of the capability
.Fa id ,
places it in the buffer at
.Fa area ,
and advances the
.Fa area
pointer.
The
.Fn kgetstr
function
returns
.Dv NULL
if the capability was not found.
.Pp
.Sh FILES
.Bl -tag -width /usr/share/misc/keycap.pcvt -compact
.It Pa /usr/share/misc/keycap.pcvt
Keyboard capabilities database (if nothing else chosen during installation).
.El
.Sh SEE ALSO
.Xr kcon 1 ,
.Xr keycap 5
OpenPOWER on IntegriCloud