1XkbSetNames(3) XKB FUNCTIONS XkbSetNames(3)
2
3
4
6 XkbSetNames - Change the symbolic names in the server
7
9 Bool XkbSetNames (Display *dpy, unsigned int which, unsigned int
10 first_type, unsigned int num_types, XkbDescPtr xkb);
11
13 - dpy connection to the X server
14
15 - which
16 mask of names or map components to be changed
17
18 - first_type
19 first type whose name is to be changed
20
21 - num_types
22 number of types for which names are to be changed
23
24 - xkb keyboard description from which names are to be taken
25
27 To change the symbolic names in the server, first modify a local copy
28 of the keyboard description and then use either XkbSetNames, or, to
29 save network traffic, use a XkbNameChangesRecstructure and call
30 XkbChangeNames to download the changes to the server. XkbSetNames and
31 XkbChangeNames can generate BadAlloc, BadAtom, BadLength, BadMatch, and
32 BadImplementation errors.
33
34 Use XkbSetNames to change many names at the same time. For each bit set
35 in which, XkbSetNames takes the corresponding value (or values in the
36 case of arrays) from the keyboard description xkb and sends it to the
37 server.
38
39 The first_type and num_types arguments are used only if XkbKeyType‐
40 NamesMask or XkbKTLevelNamesMask is set in which and specify a subset
41 of the types for which the corresponding names are to be changed. If
42 either or both of these mask bits are set but the specified types are
43 illegal, XkbSetNames returns False and does not update any of the names
44 specified in which. The specified types are illegal if xkb does not
45 include a map component or if first_type and num_types specify types
46 that are not defined in the keyboard description.
47
49 The XkbNameChangesRec allows applications to identify small modifica‐
50 tions to the symbolic names and effectively reduces the amount of traf‐
51 fic sent to the server:
52
53 typedef struct _XkbNameChanges {
54 unsigned int changed; /∗ name components that have changed */
55 unsigned char first_type; /∗ first key type with a new name */
56 unsigned char num_types; /∗ number of types with new names */
57 unsigned char first_lvl; /∗ first key type with new level names
58 */
59 unsigned char num_lvls; /∗ number of key types with new level
60 names */
61 unsigned char num_aliases; /∗ if key aliases changed, total number
62 of key aliases */
63 unsigned char num_rg; /∗ if radio groups changed, total
64 number of radio groups */
65 unsigned char first_key; /∗ first key with a new name */
66 unsigned char num_keys; /∗ number of keys with new names */
67 unsigned short changed_vmods; /∗ mask of virtual modifiers for which
68 names have changed */
69 unsigned long changed_indicators; /∗ mask of indicators for which names
70 were changed */
71 unsigned char changed_groups; /∗ mask of groups for which names
72 were changed */
73 } XkbNameChangesRec, *XkbNameChangesPtr
74
75 The changed field specifies the name components that have changed and
76 is the bitwise inclusive OR of the valid names mask bits defined in Ta‐
77 ble 1. The rest of the fields in the structure specify the ranges that
78 have changed for the various kinds of symbolic names, as shown in Table
79 2.
80
81 Xkb provides several functions that work with symbolic names. Each of
82 these functions uses a mask to specify individual fields of the struc‐
83 tures described above. These masks and their relationships to the
84 fields in a keyboard description are shown in Table 1.
85
86
87 Table 1 Symbolic Names Masks
88 ─────────────────────────────────────────────────────────────────────────────────
89 Mask Bit Value Keyboard Field
90 Component
91 ─────────────────────────────────────────────────────────────────────────────────
92 XkbKeycodesNameMask (1<<0) Xkb->names keycodes
93 XkbGeometryNameMask (1<<1) Xkb->names geometry
94 XkbSymbolsNameMask (1<<2) Xkb->names symbols
95 XkbPhysSymbolsNameMask (1<<3) Xkb->names phys_symbols
96 XkbTypesNameMask (1<<4) Xkb->names type
97 XkbCompatNameMask (1<<5) Xkb->names compat
98 XkbKeyTypeNamesMask (1<<6) Xkb->map type[*].name
99 XkbKTLevelNamesMask (1<<7) Xkb->map type[*].lvl_names[*]
100 XkbIndicatorNamesMask (1<<8) Xkb->names indicators[*]
101 XkbKeyNamesMask (1<<9) Xkb->names keys[*], num_keys
102 XkbKeyAliasesMask (1<<10) Xkb->names key_aliases[*], num_key_aliases
103 XkbVirtualModNamesMask (1<<11) Xkb->names vmods[*]
104 XkbGroupNamesMask (1<<12) Xkb->names groups[*]
105 XkbRGNamesMask (1<<13) Xkb->names radio_groups[*], num_rg
106 XkbComponentNamesMask (0x3f) Xkb->names keycodes,
107 geometry,
108 symbols,
109 physical symbols,
110 types, and
111 compatibility map
112 XkbAllNamesMask (0x3fff) Xkb->names all name components
113
114
115 Table 2 XkbNameChanges Fields
116 ────────────────────────────────────────────────────────────────────────────────
117 Mask Fields Component Field
118 ────────────────────────────────────────────────────────────────────────────────
119 XkbKeyTypeNamesMask first_type, Xkb->map type[*].name
120 num_types
121 XkbKTLevelNamesMask first_lvl, Xkb->map type[*].lvl_names[*]
122 num_lvls
123 XkbKeyAliasesMask num_aliases Xkb->names key_aliases[*]
124 XkbRGNamesMask num_rg Xkb->names radio_groups[*]
125 XkbKeyNamesMask first_key, Xkb->names keys[*]
126 num_keys
127 XkbVirtualModNamesMask changed_vmods Xkb->names vmods[*]
128 XkbIndicatorNamesMask changed_indicators Xkb->names indicators[*]
129 XkbGroupNamesMask changed_groups Xkb->names groups[*]
130
132 BadAlloc Unable to allocate storage
133
134 BadAtom A name is neither a valid Atom or None
135
136 BadImplementation
137 Invalid reply from server
138
139 BadLength The length of a request is shorter or longer than that
140 required to minimally contain the arguments
141
142 BadMatch A compatible version of Xkb was not available in the
143 server or an argument has correct type and range, but is
144 otherwise invalid
145
147 XkbChangeNames(3)
148
149
150
151X Version 11 libX11 1.6.5 XkbSetNames(3)