1XkbKeyTypesForCoreSymbols(3) XKB FUNCTIONS XkbKeyTypesForCoreSymbols(3)
2
3
4
6 XkbKeyTypesForCoreSymbols - Determine the Xkb key types appropriate for
7 the symbols bound to a key in a core keyboard mapping
8
10 int XkbKeyTypesForCoreSymbols (XkbDescPtr xkb, int map_width, KeySym
11 *core_syms, unsigned int protected, int *types_inout, KeySym
12 *xkb_syms_rtrn);
13
15 - xkb keyboard description in which to place symbols
16
17 - map_width
18 width of core protocol keymap in xkb_syms_rtrn
19
20 - core_syms
21 core protocol format array of KeySyms
22
23 - protected
24 explicit key types
25
26 - types_inout
27 backfilled with the canonical types bound to groups one and two
28 for the key
29
30 - xkb_syms_rtrn
31 backfilled with symbols bound to the key in the Xkb mapping
32
34 XkbKeyTypesForCoreSymbols expands the symbols in core_syms and types in
35 types_inout, then chooses canonical key types (canonical key types are
36 defined The Canonical Key Types) for groups 1 and 2 using the rules
37 specified by the Xkb protocol and places them in xkb_syms_rtrn, which
38 will be non-NULL.
39
40 The Canonical Key Types
41
42 Xkb allows up to XkbMaxKeyTypes (255) key types to be defined, but
43 requires at least XkbNumRequiredTypes (4) predefined types to be in a
44 key map. These predefined key types are referred to as the canonical
45 key types and describe the types of keys available on most keyboards.
46 The definitions for the canonical key types are held in the first Xkb‐
47 NumRequiredTypes entries of the types field of the client map and are
48 indexed using the following constants:
49
50 XkbOneLevelIndex
51 XkbTwoLevelIndex
52 XkbAlphabeticIndex
53 XkbKeypadIndex
54
55
56 ONE_LEVEL
57
58 The ONE_LEVEL key type describes groups that have only one symbol. The
59 default ONE_LEVEL key type has no map entries and does not pay atten‐
60 tion to any modifiers. A symbolic representation of this key type could
61 look like the following:
62
63 type "ONE_LEVEL" {
64 modifiers = None;
65 map[None]= Level1;
66 level_name[Level1]= "Any";
67 };
68
69 The description of the ONE_LEVEL key type is stored in the
70 types[XkbOneLevelIndex] entry of the client key map.
71
72 TWO_LEVEL
73
74 The TWO_LEVEL key type describes groups that consist of two symbols but
75 are neither alphabetic nor numeric keypad keys. The default TWO_LEVEL
76 type uses only the Shift modifier. It returns shift level two if Shift
77 is set, and level one if it is not. A symbolic representation of this
78 key type could look like the following:
79
80 type "TWO_LEVEL" {
81 modifiers = Shift;
82 map[Shift]= Level2;
83 level_name[Level1]= "Base";
84 level_name[Level2]= "Shift";
85 };
86
87
88 The description of the TWO_LEVEL key type is stored in the types[XkbT‐
89 woLevelIndex] entry of the client key map.
90
91 ALPHABETIC
92
93 The ALPHABETIC key type describes groups consisting of two symbols: the
94 lowercase form of a symbol followed by the uppercase form of the same
95 symbol. The default ALPHABETIC type implements locale-sensitive "Shift
96 cancels CapsLock" behavior using both the Shift and Lock modifiers as
97 follows:
98
99
100 · If Shift and Lock are both set, the default ALPHABETIC type yields
101 level one.
102
103 · If Shift alone is set, it yields level two.
104
105 · If Lock alone is set, it yields level one, but preserves the Lock
106 modifier so Xlib notices and applies the appropriate capitaliza‐
107 tion rules. The Xlib functions are locale-sensitive and apply dif‐
108 ferent capitalization rules for different locales.
109
110 · If neither Shift nor Lock is set, it yields level one.
111
112 A symbolic representation of this key type could look like the
113 following:
114
115 type "ALPHABETIC" {
116 modifiers = Shift+Lock;
117 map[Shift]= Level2;
118 preserve[Lock]= Lock;
119 level_name[Level1]= "Base";
120 level_name[Level2]= "Caps";
121 };
122
123 The description of the ALPHABETIC key type is stored in the
124 types[XkbAlphabeticIndex] entry of the client key map.
125
126 KEYPAD
127
128 The KEYPAD key type describes groups that consist of two symbols,
129 at least one of which is a numeric keypad symbol. The numeric key‐
130 pad symbol is assumed to reside at level two. The default KEYPAD
131 key type implements "Shift cancels NumLock" behavior using the
132 Shift modifier and the real modifier bound to the virtual modifier
133 named "NumLock," known as the NumLock modifier, as follows:
134
135
136 · If Shift and NumLock are both set, the default KEYPAD type yields
137 level one.
138
139 · If Shift alone is set, it yields level two.
140
141 · If NumLock alone is set, it yields level two.
142
143 · If neither Shift nor NumLock is set, it yields level one.
144
145 A symbolic representation of this key type could look like the
146 following:
147
148 type "KEYPAD" {
149 modifiers = Shift+NumLock;
150 map[None]= Level1;
151 map[Shift]= Level2;
152 map[NumLock]= Level2;
153 map[Shift+NumLock]= Level1;
154 level_name[Level1]= "Base";
155 level_name[Level2]= "Caps";
156 };
157
158 The description of the KEYPAD key type is stored in the
159 types[XkbKeypadIndex] entry of the client key map.
160
161 A core keymap is a two-dimensional array of keysyms. It has
162 map_width columns and max_key_code rows. XkbKeyTypesForCoreSym‐
163 bols takes a single row from a core keymap, determines the number
164 of groups associated with it, the type of each group, and the sym‐
165 bols bound to each group. The return value is the number of
166 groups, types_inout has the types for each group, and
167 xkb_syms_rtrn has the symbols in Xkb order (that is, groups are
168 contiguous, regardless of size).
169
170 protected contains the explicitly protected key types. There is
171 one explicit override control associated with each of the four
172 possible groups for each Xkb key, ExplicitKeyType1 through Explic‐
173 itKeyType4; protected is an inclusive OR of these controls.
174 map_width is the width of the core keymap and is not dependent on
175 any Xkb definitions. types_inout is an array of four type
176 indices. On input, types_inout contains the indices of any types
177 already assigned to the key, in case they are explicitly protected
178 from change.
179
180 Upon return, types_inout contains any automatically selected (that
181 is, canonical) types plus any protected types. Canonical types are
182 assigned to all four groups if there are enough symbols to do so.
183 The four entries in types_inout correspond to the four groups for
184 the key in question.
185
186
187
188X Version 11 libX11 1.6.7 XkbKeyTypesForCoreSymbols(3)