XkbLookupKeyBinding(3)

πŸ’– NAME πŸ’–

Okay so you've landed on the <rainbow>XKB FUNCTIONS</rainbow> page for XkbLookupKeyBinding(3), bestie β€” and it does exactly what the name says: Find the string bound to a key by XRebindKeySym πŸ’…βœ¨


✨ SYNOPSIS ✨

int XkbLookupKeyBinding (Display *dpy, KeySym sym, unsigned int state,
       char *buf, int nbytes, int *extra_rtrn);

πŸŽ€ ARGUMENTS πŸŽ€

  • dpy β€” connection to server.
  • sym β€” connection to server. (Yep, the page says this for sym too β€” not me, I'm just reporting the tea β˜•πŸ˜­)
  • state β€” state for which string is to be looked up.
  • buf β€” buffer into which returned string is written.
  • nbytes β€” size of buffer in bytes.
  • extra_rtrn β€” backfilled with number bytes overflow.

🌸 DESCRIPTION 🌸

XkbLookupKeyBinding is the equivalent of the core XLookupString function. No cap. 🫢

XRebindKeysym binds an ASCII string to a specified keysym, so that the string and keysym are returned when the key is pressed and a specified list of modifiers are also being held down. That's the whole vibe: key + modifiers + string, all matched up. πŸ‘‘

XkbLookupKeyBinding returns in buf the string associated with the keysym sym and modifier state state. buf is NULL terminated unless there's an overflow. 🫧

If the string returned is larger than nbytes, a count of bytes that does not fit into the buffer is returned in extra_rtrn. So if it's giving too-big-for-the-buffer energy, extra_rtrn tells you how many bytes didn't make it. πŸ’€

And bestie, the last line of the description says XkbTranslateKeySym returns the number of bytes that it placed into buf β€” yes, that's the exact function name in the text, keep it that way. πŸ‘€

πŸ¦‹ SEE ALSO πŸ¦‹


That's the whole page, bestie β€” signed, sealed, and slayed by <rainbow>X Version 11</rainbow> + <rainbow>libX11 1.8.14</rainbow> for XkbLookupKeyBinding(3) βœ¨πŸ’…πŸŽ€

πŸ“¦ where this page comes from