XkbAllocServerMap(3)

✨ NAME ✨

Okay bestie, welcome to XkbAllocServerMap(3) from the XKB FUNCTIONS manual. This one is all about allocating and initializing an empty server map description record. πŸ’–

✨ SYNOPSIS ✨

Status XkbAllocServerMap (XkbDescPtr xkb, unsigned int which, unsigned
       int count_acts);

πŸŽ€ ARGUMENTS πŸŽ€

  • xkb β€” the keyboard description where you want to allocate the server map, bestie.
  • which β€” a mask that selects which map components to allocate. It's giving "choose your fighter." πŸ’…
  • count_acts β€” the value for the num_acts field in the map that's getting allocated.

🌸 DESCRIPTION 🌸

So XkbAllocServerMap allocates and initializes an empty server map in the server field of the keyboard description specified by xkb, no cap. The which parameter says which particular components of the server map structure to allocate, exactly as listed in Table 1. πŸ‘‘

πŸ¦‹ Table 1: XkbAllocServerMap Masks πŸ¦‹

  • XkbExplicitComponentsMask β€” The min_key_code and max_key_code fields of the xkb parameter are used to allocate the explicit field of the server map.
  • XkbKeyActionsMask β€” The min_key_code and max_key_code fields of the xkb parameter are used to allocate the key_acts field of the server map. The count_acts parameter is used to allocate the acts field of the server map.
  • XkbKeyBehaviorsMask β€” The min_key_code and max_key_code fields of the xkb parameter are used to allocate the behaviors field of the server map.
  • XkbVirtualModMapMask β€” The min_key_code and max_key_code fields of the xkb parameter are used to allocate the vmodmap field of the server map.

If the server map of the keyboard description is not NULL and any fields are already allocated in the server map, XkbAllocServerMap does not overwrite the existing values. The only exception is with the acts array. If the count_acts parameter is greater than the current num_acts field of the server map, XkbAllocServerMap resizes the acts array and resets the num_acts field accordingly. πŸ”₯

If XkbAllocServerMap is successful, it returns Success. Otherwise, it can return either BadMatch or BadAlloc errors. 🫢

πŸ’€ DIAGNOSTICS πŸ’€

  • BadAlloc β€” Unable to allocate storage.
  • BadMatch β€” A compatible version of Xkb was not available in the server or an argument has correct type and range, but is otherwise invalid.
  • BadValue β€” An argument is out of range.

⭐ NOTES ⭐

The min_key_code and max_key_code fields of the xkb parameter must be legal values. If they are not valid, XkbAllocServerMap returns BadValue. So yeah, keep those codes legal or the function is gonna have a whole moment. 😭


Cute little footer sign-off, bestie: this page comes from X Version 11, libX11 1.8.14, and it's the XkbAllocServerMap(3) page. The original footer does not show a date, so I'm not inventing oneβ€”periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from