XkbTranslateKeyCode(3)
π NAME π
XkbTranslateKeyCode(3) β from the XKB FUNCTIONS manual β is literally the function that translates a keycode to a key symbol and modifiers. Bestie, itβs giving keyboard translator era and Iβm obsessed. π
β¨ SYNOPSIS β¨
Bool XkbTranslateKeyCode (XkbDescPtr xkb, KeyCode key, unsigned int
mods, unsigned int *mods_rtrn, KeySym *keysym_rtrn);
π§ ARGUMENTS π§
xkbβ the keyboard description to use for translation. Like the map, the lore, the whole keyboard vibe. πΊοΈkeyβ the keycode to translate. The raw key ID stepping into the function. πmodsβ modifiers to apply when translating the key. The modifier energy youβre feeding in. β¨mods_rtrnβ backfilled with consumed modifiers. Yes, itβs the output slot, not a typo. πkeysym_rtrnβ keysym resulting from translation. The final symbol reveal. π
π DESCRIPTION π
Okay so mods_rtrn is backfilled with the modifiers consumed by the translation process. No cap, thatβs its whole job. π«Ά
mods is a bitwise inclusive OR of the legal modifier masks: ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask. Thatβs the whole lineup, bestie β not one missing. π
The AlwaysConsumeShiftAndLock library control (see below π), if enabled, causes XkbTranslateKeyCode to consume shift and lock. Iconic behavior. π
XkbTranslateKeyCode returns True if the translation resulted in a keysym, and False if it resulted in NoSymbol. Thatβs the vibe check: symbol = True, no symbol = False. β
π
The AlwaysConsumeShiftAndLock control, if enabled, forces XLookupString to consume the Shift and Lock modifiers when processing all keys, even if the definition for the key type does not specify these modifiers. The AlwaysConsumeShiftAndLock control is unset by default. π¨
πΈ SEE ALSO πΈ
XLookupString(3)β go read that one too, bestie. π
Thatβs the whole page, periodt. π
This oneβs from X Version 11, libX11 1.8.14, and the manual page is literally XkbTranslateKeyCode(3). Mwah π
π¦ 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
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms