XkbGetKeyExplicitComponents(3)
π NAME π
ok so XkbGetKeyExplicitComponents β bestie, it grabs the explicit components (that's the explicit array, iykyk) for a subset of the keys in a keyboard description. It's the section 3 (library function) girlie from the XKB function crew. π
β¨ SYNOPSIS β¨
Status XkbGetKeyExplicitComponents (Display *dpy, unsigned int first,
unsigned int num, XkbDescPtr xkb);
πΈ ARGUMENTS πΈ
dpyβ the connection to the server, your lil phone line to the X server basically πfirstβ keycode of the first key to fetchnumβ how many keys you want explicit info forxkbβ the Xkb description where the results get dropped off
π¦ DESCRIPTION π¦
ok so picture this: whenever a client remaps the keyboard using core protocol requests, Xkb looks at the map and figures out likely default values for the components that the core protocol literally cannot specify. (More on how Xkb picks those defaults lives in "Core Keyboard Mapping to Xkb Keyboard Mapping Transformation" β go read that if you're nosy.)
β οΈ real talk: the original manpage itself has a big ol' note right here that reads: DO THE FOUR PAGES OF "CORE KEYBOARD MAPPING TO XKB KEYBOARD MAPPING TRANSFORMATION" NEED TO BE ADDED HERE? β yes bestie, that question is in the manpage. we leave it exactly as it is. no cap. π
So this automatic remapping? It might just replace definitions that an application explicitly asked for. Rude. Which is why the Xkb keyboard description defines an explicit components mask for each key. Anything listed in a key's explicit components mask does not get changed by the automatic keyboard mapping. Protection. Boundaries. Self-care. π«Ά
These explicit component masks live in the explicit field of the server map, which is an array indexed by keycode. Each entry is a mask that's a bitwise inclusive OR of the values in Table 1:
β Table 1 β Explicit Component Masks β
ExplicitKeyType1β(1<<0)β protects against automatic determination of the key type associated with Group1.ExplicitKeyType2β(1<<1)β protects against automatic determination of the key type associated with Group2.ExplicitKeyType3β(1<<2)β protects against automatic determination of the key type associated with Group3.ExplicitKeyType4β(1<<3)β protects against automatic determination of the key type associated with Group4.ExplicitInterpretβ(1<<4)β protects against application of any of the fields of a symbol interpretation to the key in question.ExplicitAutoRepeatβ(1<<5)β protects against automatic determination of auto-repeat status for the key, as specified in a symbol interpretation.ExplicitBehaviorβ(1<<6)β protects against automatic assignment of theXkbKB_Lockbehavior to the key, if theXkbSI_LockingKeyflag is set in a symbol interpretation.ExplicitVModMapβ(1<<7)β protects against automatic determination of the virtual modifier map for the key based on the actions assigned to the key and the symbol interpretations that match the key.
Now the actual function, periodt: XkbGetKeyExplicitComponents sends a request to the server to get the explicit components for num keys on the keyboard, starting at key first. Then it waits for a reply (she's patient, she's committed β¨) and returns the explicit components in the server->explicit array of xkb. If it works out, XkbGetKeyExplicitComponents returns Success. And xkb must be a pointer to a valid Xkb keyboard description β no fake ones, bestie.
If the server map inside xkb hasn't been allocated yet? No worries β XkbGetKeyExplicitComponents allocates and initializes it before obtaining the actions. Iconic behavior honestly. π
But watch out, the drama is real:
- If the server doesn't have a compatible version of Xkb, or the Xkb extension hasn't been properly initialized,
XkbGetKeyExplicitComponentsreturnsBadMatch. - If
numis less than1or greater thanXkbMaxKeyCount,XkbGetKeyExplicitComponentsreturnsBadValue. - If any allocation errors happen,
XkbGetKeyExplicitComponentsreturnsBadAlloc.
π DIAGNOSTICS π
BadAllocβ unable to allocate storage. she's out of room, no space left in the group chat π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. out of pocket, out of range, same energy fr fr.
π SIGN-OFF π
that's the whole page bestie, go protect those explicit components π from the X v11 Rel. 6.4 era, dated 20 Jul 1999, and yes this lil love letter is filed under XkbGetKeyExplicitComponents(3) β mwah, slay, bye! ππ¦β¨
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- centos-stream 10: libX11-devel 1.8.13-2.el10 Β· MIT AND X11
- fedora 43: libX11-devel 1.8.13-1.fc43 Β· MIT AND X11
- fedora 43: libX11-devel 1.8.13-1.fc43 Β· MIT AND X11
- fedora 44: libX11-devel 1.8.13-1.fc44 Β· MIT AND X11
- fedora 44: libX11-devel 1.8.13-1.fc44 Β· MIT AND X11
- fedora 44: libX11-devel 1.8.13-3.fc44 Β· MIT AND X11
- fedora 44: libX11-devel 1.8.13-3.fc44 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- ubuntu resolute: libx11-doc 2:1.8.13-1
- ubuntu resolute: libx11-doc 2:1.8.13-1ubuntu0.1
- ubuntu stonking: libx11-doc 2:1.8.13-1
- 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