XkbChangeNames(3)
π NAME π
Okay bestie, buckle up: this is XkbChangeNames(3) from the XKB FUNCTIONS manual, and it is literally about changing symbolic names in the server.
XkbChangeNames β Change symbolic names in the server β¨
β¨ SYNOPSIS β¨
Bool XkbChangeNames (Display *dpy, unsigned int which, XkbDescPtr xkb);
π ARGUMENTS π
dpyβ connection to the X server, aka the server bestie you're talking to.whichβ mask of names or map components to be updated.xkbβ keyboard description to be updated.
πΈ DESCRIPTION πΈ
So XkbChangeNames is the more flexible glow-up for changing symbolic names than XkbSetNames, and it requires the use of an XkbNameChangesRec structure. No cap.
XkbChangeNames copies any names specified by changes from the keyboard description, xkb, to the X server specified by dpy. It aborts and returns False if any illegal type names or type shift level names are specified by changes. Like, it is not going to let invalid name vibes slide. π
To change the symbolic names in the server, first modify a local copy of the keyboard description and then use either XkbSetNames, or, to save network traffic, use an XkbNameChangesRec structure and call XkbChangeNames to download the changes to the server. XkbSetNames and XkbChangeNames can generate BadAlloc, BadAtom, BadLength, BadMatch, and BadImplementation errors.
This is the "send only the diff, bestie" option. It is giving efficient network traffic, and we respect that.
π¦ STRUCTURES π¦
The XkbNameChangesRec allows applications to identify small modifications to the symbolic names and effectively reduces the amount of traffic sent to the server:
typedef struct _XkbNameChanges {
unsigned int changed; /* name components that have changed */
unsigned char first_type; /* first key type with a new name */
unsigned char num_types; /* number of types with new names */
unsigned char first_lvl; /* first key type with new level names */
unsigned char num_lvls; /* number of key types with new level names */
unsigned char num_aliases; /* if key aliases changed, total number of key aliases */
unsigned char num_rg; /* if radio groups changed, total number of radio groups */
unsigned char first_key; /* first key with a new name */
unsigned char num_keys; /* number of keys with new names */
unsigned short changed_vmods; /* mask of virtual modifiers for which names have changed */
unsigned long changed_indicators; /* mask of indicators for which names were changed */
unsigned char changed_groups; /* mask of groups for which names were changed */
} XkbNameChangesRec, *XkbNameChangesPtr
The changed field specifies the name components that have changed and is the bitwise inclusive OR of the valid names mask bits defined in Table 1. The rest of the fields in the structure specify the ranges that have changed for the various kinds of symbolic names, as shown in Table 2.
Xkb provides several functions that work with symbolic names. Each of these functions uses a mask to specify individual fields of the structures described above. These masks and their relationships to the fields in a keyboard description are shown in Table 1.
π Table 1 Symbolic Names Masks π
Columns: Mask Bit, Value, Keyboard Component, Field.
XkbKeycodesNameMaskβ(1<<0)βXkb->namesβkeycodesXkbGeometryNameMaskβ(1<<1)βXkb->namesβgeometryXkbSymbolsNameMaskβ(1<<2)βXkb->namesβsymbolsXkbPhysSymbolsNameMaskβ(1<<3)βXkb->namesβphys_symbolsXkbTypesNameMaskβ(1<<4)βXkb->namesβtypeXkbCompatNameMaskβ(1<<5)βXkb->namesβcompatXkbKeyTypeNamesMaskβ(1<<6)βXkb->mapβtype[*].nameXkbKTLevelNamesMaskβ(1<<7)βXkb->mapβtype[*].lvl_names[*]XkbIndicatorNamesMaskβ(1<<8)βXkb->namesβindicators[*]XkbKeyNamesMaskβ(1<<9)βXkb->namesβkeys[*], num_keysXkbKeyAliasesMaskβ(1<<10)βXkb->namesβkey_aliases[*], num_key_aliasesXkbVirtualModNamesMaskβ(1<<11)βXkb->namesβvmods[*]XkbGroupNamesMaskβ(1<<12)βXkb->namesβgroups[*]XkbRGNamesMaskβ(1<<13)βXkb->namesβradio_groups[*], num_rgXkbComponentNamesMaskβ(0x3f)βXkb->namesβkeycodes, geometry, symbols, physical symbols, types, and compatibility mapXkbAllNamesMaskβ(0x3fff)βXkb->namesβ all name components
β Table 2 XkbNameChanges Fields β
Columns: Mask, Fields, Component, Field.
XkbKeyTypeNamesMaskβfirst_type, num_typesβXkb->mapβtype[*].nameXkbKTLevelNamesMaskβfirst_lvl, num_lvlsβXkb->mapβtype[*].lvl_names[*]XkbKeyAliasesMaskβnum_aliasesβXkb->namesβkey_aliases[*]XkbRGNamesMaskβnum_rgβXkb->namesβradio_groups[*]XkbKeyNamesMaskβfirst_key, num_keysβXkb->namesβkeys[*]XkbVirtualModNamesMaskβchanged_vmodsβXkb->namesβvmods[*]XkbIndicatorNamesMaskβchanged_indicatorsβXkb->namesβindicators[*]XkbGroupNamesMaskβchanged_groupsβXkb->namesβgroups[*]
π DIAGNOSTICS π
BadAllocβ Unable to allocate storage.BadAtomβ A name is neither a valid Atom or None.BadImplementationβ Invalid reply from server.BadLengthβ The length of a request is shorter or longer than that required to minimally contain the arguments.BadMatchβ A compatible version of Xkb was not available in the server or an argument has correct type and range, but is otherwise invalid.
π«Ά SEE ALSO π«Ά
Mwah π and that's the whole page, bestie. Footer sign-off: this is X Version 11, libX11 1.8.14, page XkbChangeNames(3). Slay. π
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms