XkbGetKeyModifierMap(3)
π XkbGetKeyModifierMap
okay bestie, welcome to the XKB FUNCTIONS corner of the libX11 man pages β this one's all about updating the modifier map for one or more of the keys in a keyboard description. yes, that modifier map. stay with me, it slaps β¨
πΈ NAME πΈ
XkbGetKeyModifierMap β update the modifier map for one or more of the keys in a keyboard description π
β¨ SYNOPSIS β¨
Status XkbGetKeyModifierMap (Display *dpy, unsigned int first, unsigned
int num, XkbDescPtr xkb);
π¦ ARGUMENTS π¦
dpyβ your connection to the X server, the whole group chat basically πfirstβ keycode of the first key you wanna getnumβ how many keys you want info forxkbβ the keyboard description you're updating
π DESCRIPTION π
so the modmap entry of the client map is an array, indexed by keycode, that specifies the real modifiers bound to a key. and each entry? a mask made of a bitwise inclusive OR of the legal real modifiers, which are literally:
ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, and Mod5Mask
if a bit is set in a modmap entry, the corresponding key is bound to that modifier. that's it, that's the vibe π
pressing or releasing the key bound to a modifier changes the modifier set and unset state. and the particular way that modifier set and unset state changes? determined by the behavior and actions assigned to the key, no cap π«Ά
XkbGetKeyModifierMap sends a request to the server for the modifier mappings for num keys starting with the key whose keycode is first. then it waits for a reply and places the results in the xkb->map->modmap array. if it works out, XkbGetKeyModifier returns Success. (yes, the page really says XkbGetKeyModifier there β that's the original's whole thing, not me being cute π)
if the map component of the xkb parameter has not been allocated, XkbGetKeyModifierMap allocates and initializes it. main character energy: it just handles it π
π¨ heads up bestie: if a compatible version of Xkb is not available in the server or the Xkb extension has not been properly initialized,XkbGetKeySymsreturnsBadAccess. also, if any allocation errors occur while obtaining the modifier map,XkbGetKeyModifierMapreturnsBadAlloc. (again β yes,XkbGetKeySymsβ that's literally what the page says, i'm not fixing it π)
β DIAGNOSTICS β
BadAccessβ the Xkb extension has not been properly initialized πBadAllocβ unable to allocate storage π
and that's the whole page, icon behavior only π§ X Version 11 of the X world, brought to you by libX11 1.8.14 β go forth and map those modifiers, bestie ππ
π¦ 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