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 get
  • num β€” how many keys you want info for
  • xkb β€” 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, XkbGetKeySyms returns BadAccess. also, if any allocation errors occur while obtaining the modifier map, XkbGetKeyModifierMap returns BadAlloc. (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