XkbTranslateKeySym(3)

🌸 NAME 🌸

Hey bestie, welcome to XkbTranslateKeySym(3) from the XKB FUNCTIONS manual β€” the page for finding the string and symbol associated with a keysym for a given keyboard state. That’s the whole mission, no cap. πŸ’…

✨ SYNOPSIS ✨

The actual signature, verbatim, because we do not mess with code around here:

int XkbTranslateKeySym (Display *dpy, KeySym *sym_inout, unsigned int
       mods, char *buf, int nbytes, int *extra_rtrn);

πŸŽ€ ARGUMENTS πŸŽ€

  • dpy β€” connection to X server. Your server link, periodt. 🫢
  • sym_inout β€” symbol to be translated; result of translation. It goes in, and the translated result comes back through it. πŸ’–
  • mods β€” modifiers to apply to sym_inout. πŸ”₯
  • buf β€” buffer into which returned string is written. πŸŽ€
  • nbytes β€” size of buffer in bytes. πŸ“
  • extra_rtrn β€” number of bytes overflow. 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here’s the tea: XkbTranslateKeySym applies the transformations specified in mods to the symbol specified by sym_inout. ✨

It returns in buf the string, if any, associated with the keysym for the current locale. If the transformations in mods changes the keysym, sym_inout is updated accordingly. If the string returned is larger than nbytes, a count of bytes that does not fit into the buffer is returned in extra_rtrn. XkbTranslateKeySym returns the number of bytes it placed into buf. πŸ’…

Oversize string? extra_rtrn is literally the count of bytes that didn’t fit. That’s the overflow receipt, bestie. 😭

πŸ‘‘ RETURN VALUES πŸ‘‘

  • buf β€” Returns the string, if any, associated with the keysym for the current locale. πŸŽ€

And yeah, the function itself returns the number of bytes it placed into buf β€” that detail is in DESCRIPTION, and we’re not leaving it behind. πŸ’–


πŸ’– Footer sign-off, bestie: X Version 11, libX11 1.8.14, manual vibes from XKB FUNCTIONS β€” no separate date on this page’s footer, just the version stamp. Bye! πŸ’…βœ¨

πŸ“¦ where this page comes from