XkbKeySymsPtr(3)

✨ XkbKeySymsPtr(3) ✨

okay bestie, so this one lives in the XKB FUNCTIONS corner of the libX11 universe, and it's genuinely such a vibe. let me put you on πŸ’…


🌸 NAME 🌸

XkbKeySymsPtr β€” returns the pointer to the two-dimensional array of keysyms for the key corresponding to keycode

like, it hands you the keysym grid for the key you asked about. that's the whole gig. no cap. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

KeySym * XkbKeySymsPtr (XkbDescPtr xkb, KeyCode keycode);

πŸŽ€ ARGUMENTS πŸŽ€

  • xkb β€” the Xkb description of interest πŸ’– (the one you actually care about)
  • keycode β€” the keycode of interest. yes literally that one. the key you're obsessed with πŸ”₯

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the lore 🧚

the key width and the number of groups associated with a key get used to form a cute little two-dimensional array of KeySyms for a key. and bestie, this array can be different sizes for different keys β€” it's giving main character energy, every key is built different πŸ’…

the array for a single key is stored as a linear list, in row-major order. and the arrays for all of the keys live in the syms field of the client map. periodt.

so the layout is:

  • one row for each group associated with a key
  • one column for each level

and the index corresponding to a given group and shift level is computed as:

idx = group_index * key_width + shift_level

iconic formula, no notes ✨

and to actually get to the beginning of the array? you use the offset field of the key_sym_map entry for a key. that's the doorway. that's the access point. iykyk πŸšͺ

so yeah β€” XkbKeySymsPtr returns the pointer to the two-dimensional array of keysyms for the key corresponding to keycode. that's it, that's the function, and it ate πŸ’–

ngl it's literally just a pointer-returning lookup, but the pointer is the whole point, so don't sleep on it πŸ™ˆ

🌈 SEE ALSO 🌈

(this page doesn't list any SEE ALSO references, bestie β€” so there's nothing extra to link here, and we're not out here inventing them fr fr πŸ“)


X Version 11 Β· libX11 1.8.14 Β· XkbKeySymsPtr(3)

mwah, that's the whole page!! πŸ’œ go forth and pointer responsibly, queen πŸ‘‘πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from