1XkbSetNames(3)                   XKB FUNCTIONS                  XkbSetNames(3)
2
3
4

NAME

6       XkbSetNames - Change the symbolic names in the server
7

SYNOPSIS

9       Bool  XkbSetNames  (Display  *dpy,  unsigned  int  which,  unsigned int
10              first_type, unsigned int num_types, XkbDescPtr xkb);
11

ARGUMENTS

13       dpy    connection to the X server
14
15       which  mask of names or map components to be changed
16
17       first_type
18              first type whose name is to be changed
19
20       num_types
21              number of types for which names are to be changed
22
23       xkb    keyboard description from which names are to be taken
24

DESCRIPTION

26       To change the symbolic names in the server, first modify a  local  copy
27       of  the  keyboard  description  and then use either XkbSetNames, or, to
28       save network traffic, use a  XkbNameChangesRecstructure  and  call  Xk‐
29       bChangeNames  to  download  the changes to the server.  XkbSetNames and
30       XkbChangeNames can generate BadAlloc, BadAtom, BadLength, BadMatch, and
31       BadImplementation errors.
32
33       Use XkbSetNames to change many names at the same time. For each bit set
34       in which, XkbSetNames takes the corresponding value (or values  in  the
35       case  of  arrays) from the keyboard description xkb and sends it to the
36       server.
37
38       The first_type and num_types arguments are  used  only  if  XkbKeyType‐
39       NamesMask  or  XkbKTLevelNamesMask is set in which and specify a subset
40       of the types for which the corresponding names are to  be  changed.  If
41       either  or  both of these mask bits are set but the specified types are
42       illegal, XkbSetNames returns False and does not update any of the names
43       specified  in  which.   The specified types are illegal if xkb does not
44       include a map component or if first_type and  num_types  specify  types
45       that are not defined in the keyboard description.
46

STRUCTURES

48       The  XkbNameChangesRec  allows applications to identify small modifica‐
49       tions to the symbolic names and effectively reduces the amount of traf‐
50       fic sent to the server:
51
52           typedef struct _XkbNameChanges {
53               unsigned int   changed;          /* name components that have changed */
54               unsigned char  first_type;       /* first key type with a new name */
55               unsigned char  num_types;        /* number of types with new names */
56               unsigned char  first_lvl;        /* first key type with new level names */
57               unsigned char  num_lvls;         /* number of key types with new level names */
58               unsigned char  num_aliases;      /* if key aliases changed, total number of key aliases */
59               unsigned char  num_rg;           /* if radio groups changed, total number of radio groups */
60               unsigned char  first_key;        /* first key with a new name */
61               unsigned char  num_keys;         /* number of keys with new names */
62               unsigned short changed_vmods;    /* mask of virtual modifiers for which names have changed */
63               unsigned long  changed_indicators; /* mask of indicators for which names were changed */
64               unsigned char  changed_groups;     /* mask of groups for which names were changed */
65           } XkbNameChangesRec, *XkbNameChangesPtr
66
67       The  changed  field specifies the name components that have changed and
68       is the bitwise inclusive OR of the valid names mask bits defined in Ta‐
69       ble  1. The rest of the fields in the structure specify the ranges that
70       have changed for the various kinds of symbolic names, as shown in Table
71       2.
72
73       Xkb  provides  several functions that work with symbolic names. Each of
74       these functions uses a mask to specify individual fields of the  struc‐
75       tures  described  above.  These  masks  and  their relationships to the
76       fields in a keyboard description are shown in Table 1.
77
78
79                                 Table 1 Symbolic Names Masks
80       ─────────────────────────────────────────────────────────────────────────────────
81       Mask Bit                 Value      Keyboard     Field
82                                           Component
83       ─────────────────────────────────────────────────────────────────────────────────
84       XkbKeycodesNameMask      (1<<0)     Xkb->names   keycodes
85       XkbGeometryNameMask      (1<<1)     Xkb->names   geometry
86       XkbSymbolsNameMask       (1<<2)     Xkb->names   symbols
87       XkbPhysSymbolsNameMask   (1<<3)     Xkb->names   phys_symbols
88       XkbTypesNameMask         (1<<4)     Xkb->names   type
89       XkbCompatNameMask        (1<<5)     Xkb->names   compat
90       XkbKeyTypeNamesMask      (1<<6)     Xkb->map     type[*].name
91       XkbKTLevelNamesMask      (1<<7)     Xkb->map     type[*].lvl_names[*]
92       XkbIndicatorNamesMask    (1<<8)     Xkb->names   indicators[*]
93       XkbKeyNamesMask          (1<<9)     Xkb->names   keys[*], num_keys
94       XkbKeyAliasesMask        (1<<10)    Xkb->names   key_aliases[*], num_key_aliases
95       XkbVirtualModNamesMask   (1<<11)    Xkb->names   vmods[*]
96       XkbGroupNamesMask        (1<<12)    Xkb->names   groups[*]
97       XkbRGNamesMask           (1<<13)    Xkb->names   radio_groups[*], num_rg
98       XkbComponentNamesMask    (0x3f)     Xkb->names   keycodes,
99                                                        geometry,
100                                                        symbols,
101                                                        physical symbols,
102                                                        types, and
103                                                        compatibility map
104       XkbAllNamesMask          (0x3fff)   Xkb->names   all name components
105
106
107                                Table 2 XkbNameChanges Fields
108       ────────────────────────────────────────────────────────────────────────────────
109       Mask                     Fields               Component    Field
110       ────────────────────────────────────────────────────────────────────────────────
111       XkbKeyTypeNamesMask      first_type,          Xkb->map     type[*].name
112                                num_types
113       XkbKTLevelNamesMask      first_lvl,           Xkb->map     type[*].lvl_names[*]
114                                num_lvls
115       XkbKeyAliasesMask        num_aliases          Xkb->names   key_aliases[*]
116       XkbRGNamesMask           num_rg               Xkb->names   radio_groups[*]
117       XkbKeyNamesMask          first_key,           Xkb->names   keys[*]
118                                num_keys
119       XkbVirtualModNamesMask   changed_vmods        Xkb->names   vmods[*]
120       XkbIndicatorNamesMask    changed_indicators   Xkb->names   indicators[*]
121       XkbGroupNamesMask        changed_groups       Xkb->names   groups[*]
122

DIAGNOSTICS

124       BadAlloc       Unable to allocate storage
125
126       BadAtom        A name is neither a valid Atom or None
127
128       BadImplementation
129                      Invalid reply from server
130
131       BadLength      The length of a request is shorter or longer  than  that
132                      required to minimally contain the arguments
133
134       BadMatch       A  compatible  version  of  Xkb was not available in the
135                      server or an argument has correct type and range, but is
136                      otherwise invalid
137

SEE ALSO

139       XkbChangeNames(3)
140
141
142
143X Version 11                     libX11 1.8.7                   XkbSetNames(3)
Impressum