2 .\" Copyright 1999 Oracle and/or its affiliates. All rights reserved.
4 .\" Permission is hereby granted, free of charge, to any person obtaining a
5 .\" copy of this software and associated documentation files (the "Software"),
6 .\" to deal in the Software without restriction, including without limitation
7 .\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 .\" and/or sell copies of the Software, and to permit persons to whom the
9 .\" Software is furnished to do so, subject to the following conditions:
11 .\" The above copyright notice and this permission notice (including the next
12 .\" paragraph) shall be included in all copies or substantial portions of the
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 .\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 .\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 .\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 .\" DEALINGS IN THE SOFTWARE.
23 .TH XkbKeyTypesForCoreSymbols __libmansuffix__ __xorgversion__ "XKB FUNCTIONS"
25 XkbKeyTypesForCoreSymbols \- Determine the Xkb key types appropriate for the
26 symbols bound to a key in a core keyboard mapping
29 .B int XkbKeyTypesForCoreSymbols
30 .BI "(\^XkbDescPtr " "xkb" "\^,"
31 .BI "int " "map_width" "\^,"
32 .BI "KeySym *" "core_syms" "\^,"
33 .BI "unsigned int " "protected" "\^,"
34 .BI "int *" "types_inout" "\^,"
35 .BI "KeySym *" "xkb_syms_rtrn" "\^);"
41 keyboard description in which to place symbols
44 width of core protocol keymap in xkb_syms_rtrn
47 core protocol format array of KeySyms
53 backfilled with the canonical types bound to groups one and two for the key
56 backfilled with symbols bound to the key in the Xkb mapping
59 .I XkbKeyTypesForCoreSymbols
60 expands the symbols in
64 then chooses canonical key types (canonical key types are
65 defined The Canonical Key Types) for groups 1 and 2 using the rules specified by
66 the Xkb protocol and places them in xkb_syms_rtrn, which will be non-NULL.
68 .B The Canonical Key Types
70 Xkb allows up to XkbMaxKeyTypes (255) key types to be defined, but requires at
71 least XkbNumRequiredTypes (4) predefined types to be in a key map. These
72 predefined key types are referred to as the canonical key types and describe the
73 types of keys available on most keyboards. The definitions for the canonical key
74 types are held in the first XkbNumRequiredTypes entries of the
76 field of the client map and are indexed using the following constants:
88 The ONE_LEVEL key type describes groups that have only one symbol. The default
89 ONE_LEVEL key type has no map entries and does not pay attention to any
90 modifiers. A symbolic representation of this key type could look like the
97 level_name[Level1]= "Any";
101 The description of the ONE_LEVEL key type is stored in the
102 types[XkbOneLevelIndex] entry of the client key map.
106 The TWO_LEVEL key type describes groups that consist of two symbols but are
107 neither alphabetic nor numeric keypad keys. The default TWO_LEVEL type uses only
108 the Shift modifier. It returns shift level two if Shift is set, and level one if
109 it is not. A symbolic representation of this key type could look like the
116 level_name[Level1]= "Base";
117 level_name[Level2]= "Shift";
122 The description of the TWO_LEVEL key type is stored in the
123 types[XkbTwoLevelIndex] entry of the client key map.
127 The ALPHABETIC key type describes groups consisting of two symbols: the
128 lowercase form of a symbol followed by the uppercase form of the same symbol.
129 The default ALPHABETIC type implements locale-sensitive "Shift cancels CapsLock"
130 behavior using both the Shift and Lock modifiers as follows:
133 If Shift and Lock are both set, the default ALPHABETIC type yields level one.
135 If Shift alone is set, it yields level two.
137 If Lock alone is set, it yields level one, but preserves the Lock modifier so
138 Xlib notices and applies the appropriate capitalization rules. The Xlib
139 functions are locale-sensitive and apply different capitalization rules for
142 If neither Shift nor Lock is set, it yields level one.
144 A symbolic representation of this key type could look like the following:
148 modifiers = Shift+Lock;
150 preserve[Lock]= Lock;
151 level_name[Level1]= "Base";
152 level_name[Level2]= "Caps";
156 The description of the ALPHABETIC key type is stored in the
157 types[XkbAlphabeticIndex] entry of the client key map.
161 The KEYPAD key type describes groups that consist of two symbols, at least one
162 of which is a numeric keypad symbol. The numeric keypad symbol is assumed to
163 reside at level two. The default KEYPAD key type implements "Shift cancels
164 NumLock" behavior using the Shift modifier and the real modifier bound to the
165 virtual modifier named "NumLock," known as the NumLock modifier, as follows:
168 If Shift and NumLock are both set, the default KEYPAD type yields level one.
170 If Shift alone is set, it yields level two.
172 If NumLock alone is set, it yields level two.
174 If neither Shift nor NumLock is set, it yields level one.
176 A symbolic representation of this key type could look like the following:
180 modifiers = Shift+NumLock;
183 map[NumLock]= Level2;
184 map[Shift+NumLock]= Level1;
185 level_name[Level1]= "Base";
186 level_name[Level2]= "Caps";
190 The description of the KEYPAD key type is stored in the types[XkbKeypadIndex]
191 entry of the client key map.
193 A core keymap is a two-dimensional array of keysyms. It has
198 .I XkbKeyTypesForCoreSymbols
199 takes a single row from a core keymap, determines the number of groups
200 associated with it, the type of each group, and the symbols bound to each group.
201 The return value is the number of groups,
203 has the types for each group, and
205 has the symbols in Xkb order (that is, groups are contiguous, regardless of
209 contains the explicitly protected key types. There is one explicit override
210 control associated with each of the four possible groups for each Xkb key,
211 ExplicitKeyType1 through ExplicitKeyType4;
213 is an inclusive OR of these controls.
215 is the width of the core keymap and is not dependent on any Xkb definitions.
217 is an array of four type indices. On input,
219 contains the indices of any types already assigned to the key, in case they are
220 explicitly protected from change.
224 contains any automatically selected (that is, canonical) types plus any
225 protected types. Canonical types are assigned to all four groups if there are
226 enough symbols to do so. The four entries in
228 correspond to the four groups for the key in question.