XkbKeyType(3)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian bookworm

πŸ’– XkbKeyType(3) β€” XKB FUNCTIONS πŸ’–

okay bestie, welcome to the glow-up zone where we talk about XkbKeyType, a lil function from the XKB FUNCTIONS part of the X11 world πŸ¦‹ (yes, the man page header literally says XKB FUNCTIONS, and yes we're still gonna make it cute).


✨ NAME ✨

XkbKeyType β€” bestie, this one has main character energy in two whole ways: it can hand you the index of a key type or the pointer to a key type πŸ‘‘πŸ’…


🌸 SYNOPSIS 🌸

XkbKeyTypePtr XkbKeyType (XkbDescPtr xkb, KeyCode keycode, int group);

πŸŽ€ ARGUMENTS πŸŽ€

  • xkb β€” the Xkb description you're interested in, like the whole vibe you're investigating πŸ”
  • keycode β€” the keycode of interest. yes, that keycode 🫢
  • group β€” the group index, bestie. the group. the index. iconic.

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea, fr fr: XkbKeyType returns a pointer to the key type in the types vector of the client map in xkb that corresponds to the given keycode and group index ✨

like, you hand it a keycode and a group, and it's like "oh bet, here's the key type you were looking for" and gives you that pointer. no cap. 🧚


πŸ¦‹ STRUCTURES πŸ¦‹

here's the struct, and bestie I need you to read the comments, because some of them are literally warning you not to touch stuff 😭

typedef struct {                             /* Key Type */
     XkbModsRec              mods;           /* modifiers used to compute shift level */
     unsigned char           num_levels;     /* total # shift levels, do not modify directly */
     unsigned char           map_count;      /* # entries in map, preserve (if non-NULL) */
     XkbKTMapEntryPtr        map;            /* vector of modifiers for each shift level */
     XkbModsPtr              preserve;       /* mods to preserve for corresponding map entry */
     Atom                    name;           /* name of key type */
     Atom *                  level_names;    /* array of names of each shift level */
} XkbKeyTypeRec, *XkbKeyTypePtr;

quick field rundown, because we're thorough in this house 🫢:

  • mods β€” the modifiers used to compute the shift level.
  • num_levels β€” total number of shift levels. ⚠️ do not modify directly, bestie, I'm serious, hands off πŸ’€
  • map_count β€” number of entries in map. preserve it (if it's non-NULL) πŸ™ˆ
  • map β€” vector of modifiers for each shift level.
  • preserve β€” the mods to preserve for the corresponding map entry.
  • name β€” name of the key type ✨
  • level_names β€” array of names of each shift level 🌈

and that's the whole struct: XkbKeyTypeRec, plus the pointer typedef XkbKeyTypePtr πŸ’–


lowkey a whole vibe check: this is X Version 11, from libX11 1.8.4, and the page is XkbKeyType(3). mwah, slay, periodt πŸ’…πŸŒΈ
πŸ“¦ where this page comes from