XkbAllocCompatMap(3)

πŸ’… XkbAllocCompatMap(3) β€” XKB FUNCTIONS ✨

🌸 NAME 🌸

XkbAllocCompatMap β€” allocate a brand-new compatibility map when you don’t already have one available, bestie πŸ’–

✨ SYNOPSIS ✨

Status XkbAllocCompatMap (XkbDescPtr xkb, unsigned int which, unsigned
       int num_si);

πŸŽ€ ARGUMENTS πŸŽ€

  • xkb β€” the keyboard description where the compat map gets allocated.
  • which β€” a mask of compatibility map components to allocate.
  • num_si β€” the number of symbol interpretations to allocate.

πŸ’– DESCRIPTION πŸ’–

Okay so xkb is the keyboard description for which compatibility maps are gonna be allocated. The compatibility map is literally the compat field inside this structure. ✨

which says which compatibility map components get allocated (peep XkbGetCompatMap for the lore). It’s an inclusive OR of the bits shown in Table 1, no cap.

Table 1 Compatibility Map Component Masks

  • XkbSymInterpMask β€” value (1<<0) β€” affecting: Symbol interpretations
  • XkbGroupCompatMask β€” value (1<<1) β€” affecting: Group maps
  • XkbAllCompatMask β€” value (0x3) β€” affecting: All compatibility map components

num_si is the total number of entries to allocate in the symbol interpretation vector, aka xkb.compat.sym_interpret.

XkbAllocCompatMap returns Success if successful, BadMatch if xkb is NULL, or BadAlloc if errors are encountered when attempting to allocate storage. Periodt. πŸ’…

πŸ¦‹ STRUCTURES πŸ¦‹

typedef struct {
    KeySym            sym;          /* keysym of interest or NULL */
    unsigned char     flags;        /* XkbSI_AutoRepeat, XkbSI_LockingKey */
    unsigned char     match;        /* specifies how mods is interpreted */
    unsigned char     mods;         /* modifier bits, correspond to eight real modifiers */
    unsigned char     virtual_mod;  /* 1 modifier to add to key virtual mod map */
    XkbAnyAction      act;          /* action to bind to symbol position on key */
} XkbSymInterpretRec,*XkbSymInterpretPtr;

πŸ’€ 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

🌈 SEE ALSO 🌈

πŸ‘‘ NOTES πŸ‘‘

Big note, bestie: symbol interpretations in a compatibility map (the sym_interpret vector of XkbSymInterpretRec structures) are also allocated using this same function. To make sure there’s enough space in the symbol interpretation vector for entries to be added, use XkbAllocCompatMap and specify which as XkbSymInterpretMask, with the number of free symbol interpretations you need in num_si. Do not skip this one. πŸ’…βœ¨


That’s the whole iconic page, signed off with X Version 11, libX11 1.8.14, and all the XkbAllocCompatMap(3) footer energy. πŸŽ€πŸ’–

πŸ“¦ where this page comes from