XkbAllocNames(3)

πŸ’– NAME πŸ’–

XkbAllocNames β€” allocate symbolic names structures. This is the XkbAllocNames(3) page, bestie, and it's here to help you allocate those names without doing the absolute most. πŸ’…


✨ SYNOPSIS ✨

       Status XkbAllocNames (XkbDescPtr xkb, unsigned int which, int num_rg,
              int num_key_aliases);

πŸŽ€ ARGUMENTS πŸŽ€

  • xkb β€” keyboard description for which names are to be allocated.
  • which β€” mask of names to be allocated.
  • num_rg β€” total number of radio group names needed.
  • num_key_aliases β€” total number of key aliases needed.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so real talk: ngl, most applications do not need to directly allocate symbolic names structures. If your application changes the number of key aliases or radio groups, or constructs a symbolic names structure without loading the necessary components from the X server, do not allocate a names structure directly using malloc or Xmalloc β€” that is not the move, bestie. Use XkbAllocNames instead. Periodt. πŸ’…

XkbAllocNames can return BadAlloc, BadMatch, and BadValue errors. The which parameter is the bitwise inclusive OR of the valid names mask bits defined in Table 1. 🧾

🧾 Table 1 Symbolic Names Masks 🧾

Each row is giving mask bit β†’ value β†’ keyboard component β†’ field, and every single one is iconic in its own way:

  • XkbKeycodesNameMask β€” value (1<<0) β€” keyboard component Xkb->names β€” field keycodes
  • XkbGeometryNameMask β€” value (1<<1) β€” keyboard component Xkb->names β€” field geometry
  • XkbSymbolsNameMask β€” value (1<<2) β€” keyboard component Xkb->names β€” field symbols
  • XkbPhysSymbolsNameMask β€” value (1<<3) β€” keyboard component Xkb->names β€” field phys_symbols
  • XkbTypesNameMask β€” value (1<<4) β€” keyboard component Xkb->names β€” field type
  • XkbCompatNameMask β€” value (1<<5) β€” keyboard component Xkb->names β€” field compat
  • XkbKeyTypeNamesMask β€” value (1<<6) β€” keyboard component Xkb->map β€” field type[*].name
  • XkbKTLevelNamesMask β€” value (1<<7) β€” keyboard component Xkb->map β€” field type[*].lvl_names[*]
  • XkbIndicatorNamesMask β€” value (1<<8) β€” keyboard component Xkb->names β€” field indicators[*]
  • XkbKeyNamesMask β€” value (1<<9) β€” keyboard component Xkb->names β€” field keys[*], num_keys
  • XkbKeyAliasesMask β€” value (1<<10) β€” keyboard component Xkb->names β€” field key_aliases[*], num_key_aliases
  • XkbVirtualModNamesMask β€” value (1<<11) β€” keyboard component Xkb->names β€” field vmods[*]
  • XkbGroupNamesMask β€” value (1<<12) β€” keyboard component Xkb->names β€” field groups[*]
  • XkbRGNamesMask β€” value (1<<13) β€” keyboard component Xkb->names β€” field radio_groups[*], num_rg
  • XkbComponentNamesMask β€” value (0x3f) β€” keyboard component Xkb->names β€” field keycodes, geometry, symbols, physical symbols, types, and compatibility map
  • XkbAllNamesMask β€” value (0x3fff) β€” keyboard component Xkb->names β€” field all name components
🚨 Bestie, do not free symbolic names structures directly using free or XFree. Use XkbFreeNames instead. That is the whole vibe check. 🫢

πŸ’… 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.

🌈 SEE ALSO 🌈

  • XkbFreeNames(3) β€” go see it, bestie. It's the names-freeing lore you need. ✨

Signing off from X Version 11 and libX11 1.8.14 β€” the footer didn't hand us a date, so no fake date, bestie πŸ˜ŒπŸ’… bye!

πŸ“¦ where this page comes from