XkbKeySymsOffset(3)
π XkbKeySymsOffset π
okay so bestie, we're in the XKB FUNCTIONS section of the libX11 manual (yes the whole X Version 11 situation, we'll get to that) and today's main character is XkbKeySymsOffset β she's a little function with one job and she does it flawlessly, no cap. β¨
πΈ NAME πΈ
XkbKeySymsOffset β returns the offset of the two-dimensional array of keysyms for the key corresponding to keycode. that's it, that's her whole personality, and honestly? iconic. π
π SYNOPSIS π
int XkbKeySymsOffset (XkbDescPtr xkb, KeyCode keycode);
π¦ ARGUMENTS π¦
xkbβ the Xkb description you're curious about. your girl, your subject of interest, the one you're staring at. πkeycodeβ the keycode of interest. the specific key we're doing a vibe check on. π
β¨ DESCRIPTION β¨
okay so listen. every key has a key width and a number of groups, right? and those two things team up to build a tiny little two-dimensional array of KeySyms just for that key. it's giving custom-made, bespoke, made-to-measure. π§
and here's the tea: this array can be a different size for different keys. no uniformity, no matching sets, every key gets to be its own unique little creature. π
now β the array for a single key isn't stored as a cute 2D grid, bestie. it's stored as a linear list, in row-major order. so it's all flattened out, one long line, but the logic is still 2D in spirit. the arrays for all of the keys live together in the syms field of the client map. one big happy family. π«Ά
the shape of it:
- one row for each group associated with a key
- one column for each level
and if you wanna know the index that corresponds to a given group and shift level, you compute it like this, exactly like this:
idx = group_index * key_width + shift_level
the offset field of the key_sym_map entry for a key is what you use to access the beginning of the array. it's the doorway, the entry point, the front gate. πͺβ¨
and finally, the moment you've all been waiting for: XkbKeySymsOffset returns the offset of the two-dimensional array of keysyms for the key corresponding to keycode. that's the whole serve. she ate. π
β οΈ real talk: thatidxformula is doing math withgroup_index,key_widthandshift_level, so keep those values exactly as they are β no improvising, no freestyling, this is not a collab. π
π a lil sign-off π
so that's the page, bestie β this one comes to you from X Version 11, libX11 1.8.4, filed under XkbKeySymsOffset(3). go forth and find your offsets. slay, stay hydrated, and remember: row-major order never betrayed anyone. πππ¦β¨
π¦ where this page comes from
- debian bookworm: libx11-doc 2:1.8.4-2+deb12u2
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms