XkbGetNames(3)

✨ XkbGetNames ✨

okay so bestie, welcome to XkbGetNames(3) β€” a little function from the XKB FUNCTIONS corner of the libX11 universe, and honestly? it's giving "the server has the lore and I need it" πŸ’…


πŸŽ€ NAME πŸŽ€

XkbGetNames β€” Obtain symbolic names from the server 🌸

like, it goes and gets the names. from the server. that's the whole vibe, no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

Status XkbGetNames (Display *dpy, unsigned int which, XkbDescPtr xkb);

πŸ’– ARGUMENTS πŸ’–

  • dpy β€” your connection to the X server, iykyk 🫢
  • which β€” a mask of names or map components that you want to be updated ✨
  • xkb β€” the keyboard description that's gonna get updated, main character energy πŸ‘‘

🌈 DESCRIPTION 🌈

so XkbGetNames retrieves symbolic names for the components of the keyboard extension from the X server, fr fr. the which parameter specifies which name components get updated inside the xkb parameter, and it's the bitwise inclusive OR of the valid names mask bits defined in Table 1, bestie 🧚

⭐ Table 1 β€” Symbolic Names Masks ⭐

  • XkbKeycodesNameMask β€” (1<<0) β€” Xkb->names β€” keycodes
  • XkbGeometryNameMask β€” (1<<1) β€” Xkb->names β€” geometry
  • XkbSymbolsNameMask β€” (1<<2) β€” Xkb->names β€” symbols
  • XkbPhysSymbolsNameMask β€” (1<<3) β€” Xkb->names β€” phys_symbols
  • XkbTypesNameMask β€” (1<<4) β€” Xkb->names β€” type
  • XkbCompatNameMask β€” (1<<5) β€” Xkb->names β€” compat
  • XkbKeyTypeNamesMask β€” (1<<6) β€” Xkb->map β€” type[*].name
  • XkbKTLevelNamesMask β€” (1<<7) β€” Xkb->map β€” type[*].lvl_names[*]
  • XkbIndicatorNamesMask β€” (1<<8) β€” Xkb->names β€” indicators[*]
  • XkbKeyNamesMask β€” (1<<9) β€” Xkb->names β€” keys[*], num_keys
  • XkbKeyAliasesMask β€” (1<<10) β€” Xkb->names β€” key_aliases[*], num_key_aliases
  • XkbVirtualModNamesMask β€” (1<<11) β€” Xkb->names β€” vmods[*]
  • XkbGroupNamesMask β€” (1<<12) β€” Xkb->names β€” groups[*]
  • XkbRGNamesMask β€” (1<<13) β€” Xkb->names β€” radio_groups[*], num_rg
  • XkbComponentNamesMask β€” (0x3f) β€” Xkb->names β€” keycodes, geometry, symbols, physical symbols, types, and compatibility map
  • XkbAllNamesMask β€” (0x3fff) β€” Xkb->names β€” all name components

like… that's the whole menu, and yes you can OR them together πŸ“


now for the fun part, the behavior πŸ‘€

if the names field of the keyboard description xkb is NULL, XkbGetNames allocates and initializes the names component of the keyboard description before obtaining the values specified by which ✨ it's literally doing setup for you, obsessed.

if the names field of xkb is not NULL, XkbGetNames obtains the values specified by which and copies them into the keyboard description Xkb πŸ’œ

🚨 heads up bestie: if the map component of the xkb parameter is NULL, XkbGetNames does not retrieve type or shift level names β€” even if XkbKeyTypeNamesMask or XkbKTLevelNamesMask are set in which. like it just won't. don't come for her 😭

XkbGetNames can return Success, or BadAlloc, BadLength, BadMatch, and BadImplementation errors.

and when you're done with your symbolic names and you wanna free them? use XkbFreeNames πŸŽ€ (see SEE ALSO, she's linked below, periodt)


πŸ’… DIAGNOSTICS πŸ’…

  • BadAlloc β€” Unable to allocate storage 😭
  • 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 πŸ”₯


and that's the whole page, bestie! this iconic lil' manual page came to you straight from X Version 11, libX11 1.8.14 β€” go forth and get those names πŸ‘‘πŸ’–βœ¨

πŸ“¦ where this page comes from