XkbResizeKeySyms(3)
β¨ XkbResizeKeySyms(3) β¨
Okay bestie, welcome to XkbResizeKeySyms(3), straight out of the XKB FUNCTIONS corner of the X manual. This is the little function that changes the number of symbols bound to a key, and yes, itβs giving βallocator eraβ π
.
π NAME π
XkbResizeKeySyms β change the number of symbols bound to a key
πΈ SYNOPSIS πΈ
KeySym * XkbResizeKeySyms (XkbDescRec *xkb, int key, int needed);
π¦ ARGUMENTS π¦
xkbβ the keyboard description you want to change, bestie.keyβ the keycode for the key youβre modifying.neededβ the new number of keysyms required for that key. Like, the target count.
π DESCRIPTION π
So XkbResizeKeySyms reserves the space needed for needed keysyms and returns a pointer to the beginning of the new array that holds the keysyms. It adjusts the offset field of the key_sym_map entry for the key if necessary, and it can also change the syms, num_syms, and size_syms fields of xkb->map if it is necessary to reallocate the syms array. Lowkey important: XkbResizeKeySyms does not modify either the width or the number of groups associated with the key. Periodt.
If needed is greater than the current number of keysyms for the key, XkbResizeKeySyms initializes all new keysyms in the array to NoSymbol. Fresh slots, no mystery vibes β¨.
Because the number of symbols needed by a key is normally computed as width * number of groups, and XkbResizeKeySyms does not modify either the width or number of groups for the key, a discrepancy exists upon return from XkbResizeKeySyms between the space allocated for the keysyms and the number required. The unused entries in the list of symbols returned by XkbResizeKeySyms are not preserved across future calls to any of the map editing functions, so you must update the key symbol mapping β which updates the width and number of groups for the key β before calling another allocator function. A call to XkbChangeTypesOfKey will update the mapping. Thatβs the main-character step, donβt skip it π«Ά.
If any allocation errors occur while resizing the number of symbols bound to the key, XkbResizeKeySyms returns NULL. Not a slay, but a fact π.
π SEE ALSO π
π NOTES π
A change to the number of symbols bound to a key should be accompanied by a change in the number of actions bound to a key. Refer to XkbResizeKeyActions for more information on changing the number of actions bound to a key. Matching energy, matching counts, iykyk π.
xoxo, this page came to you from X Version 11 and libX11 1.8.14 β thatβs the footer energy, bestie, no extra date invented, just the version and source doing their little sign-off ππ
π¦ 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