1XkbChangeTypesOfKey(3) XKB FUNCTIONS XkbChangeTypesOfKey(3)
2
3
4
6 XkbChangeTypesOfKey - Change the number of groups and the types bound
7 to a key
8
10 Status XkbChangeTypesOfKey (XkbDescPtr xkb, int key, int n_groups, un‐
11 signed int groups, int *new_types_in, XkbMapChangesPtr
12 p_changes);
13
15 - xkb keyboard description to be changed
16
17 - key keycode for key of interest
18
19 - n_groups
20 new number of groups for key
21
22 - groups
23 mask indicating groups to change
24
25 - new_types_in
26 indices for new groups specified in groups
27
28 - p_changes
29 notes changes made to xkb
30
32 XkbChangeTypesOfKey reallocates the symbols and actions bound to the
33 key, if necessary, and initializes any new symbols or actions to NoSym‐
34 bol or NoAction, as appropriate. If the p_changes parameter is not
35 NULL, XkbChangeTypesOfKey adds the XkbKeySymsMask to the changes field
36 of p_changes and modifies the first_key_sym and num_key_syms fields of
37 p_changes to include the key that was changed. See STRUCTURE for more
38 information on the XkbMapChangesPtr structure. If successful, Xk‐
39 bChangeTypesOfKey returns Success.
40
41 The n_groups parameter specifies the new number of groups for the key.
42 The groups parameter is a mask specifying the groups for which new
43 types are supplied and is a bitwise inclusive OR of the following
44 masks: XkbGroup1Mask, XkbGroup2Mask, XkbGroup3Mask, and XkbGroup4Mask.
45
46 The new_types_in parameter is an integer array of length n_groups.
47 Each entry represents the type to use for the associated group and is
48 an index into xkb->map->types. The new_types_in array is indexed by
49 group index; if n_groups is four and groups only has Group1Mask and
50 Group3Mask set, new_types_in looks like this:
51
52 new_types_in[0] = type for Group1
53 new_types_in[1] = ignored
54 new_types_in[2] = type for Group3
55 new_types_in[3] = ignored
56
57 For convenience, Xkb provides the following constants to use as indices
58 to the groups:
59
60
61 Table 1 Group Index Constants
62 ──────────────────────────────
63 Constant Name Value
64 ──────────────────────────────
65 XkbGroup1Index 0
66
67 XkbGroup2Index 1
68 XkbGroup3Index 2
69 XkbGroup4Index 3
70
71 If the Xkb extension has not been properly initialized, XkbChangeType‐
72 sOfKey returns BadAccess. If the xkb parameter it not valid (that is,
73 it is NULL or it does not contain a valid client map), XkbChangeType‐
74 sOfKey returns BadMatch. If the key is not a valid keycode, n_groups is
75 greater than XkbNumKbdGroups, or the groups mask does not contain any
76 of the valid group mask bits, XkbChangeTypesOfKey returns BadValue. If
77 it is necessary to resize the key symbols or key actions arrays and any
78 allocation errors occur, XkbChangeTypesOfKey returns BadAlloc.
79
81 Use the XkbMapChangesRec structure to identify and track partial modi‐
82 fications to the mapping components and to reduce the amount of traffic
83 between the server and clients.
84
85 typedef struct _XkbMapChanges {
86 unsigned short changed; /∗ identifies valid components in
87 structure */
88 KeyCode min_key_code; /∗ lowest numbered keycode for device
89 */
90 KeyCode max_key_code; /∗ highest numbered keycode for device
91 */
92 unsigned char first_type; /∗ index of first key type modified */
93 unsigned char num_types; /∗ # types modified */
94 KeyCode first_key_sym; /∗ first key whose key_sym_map changed
95 */
96 unsigned char num_key_syms; /∗ # key_sym_map entries changed */
97 KeyCode first_key_act; /∗ first key whose key_acts entry
98 changed */
99 unsigned char num_key_acts; /∗ # key_acts entries changed */
100 KeyCode first_key_behavior; /∗ first key whose behaviors changed */
101 unsigned char num_key_behaviors; /∗ # behaviors entries changed */
102 KeyCode first_key_explicit; /∗ first key whose explicit entry
103 changed */
104 unsigned char num_key_explicit; /∗ # explicit entries changed */
105 KeyCode first_modmap_key; /∗ first key whose modmap entry changed
106 */
107 unsigned char num_modmap_keys; /∗ # modmap entries changed */
108 KeyCode first_vmodmap_key; /∗ first key whose vmodmap changed */
109 unsigned char num_vmodmap_keys; /∗ # vmodmap entries changed */
110 unsigned char pad1; /∗ reserved */
111 unsigned short vmods; /∗ mask indicating which vmods changed
112 */
113 } XkbMapChangesRec,*XkbMapChangesPtr;
114
115
117 BadAccess The Xkb extension has not been properly initialized
118
119 BadAlloc Unable to allocate storage
120
121 BadMatch A compatible version of Xkb was not available in the
122 server or an argument has correct type and range, but is
123 otherwise invalid
124
125 BadValue An argument is out of range
126
127
128
129X Version 11 libX11 1.7.0 XkbChangeTypesOfKey(3)