XtGetActionKeysym(3)

πŸ’… XtGetActionKeysym β€” the XT FUNCTIONS girlies know

okay bestie, so this is a page from the XT FUNCTIONS corner of the X world, and it's literally called XtGetActionKeysym β€” which, iykyk, means "obtain corresponding keysym". that's the whole NAME vibe. short, sweet, iconic. πŸŽ€


✨ SYNTAX ✨

#include <X11/Intrinsic.h>

KeySym XtGetActionKeysym(XEvent* event, Modifiers* modifiers_return);

like yes, that's the whole signature. she's compact. she's serving. πŸ¦‹


🌸 ARGUMENTS 🌸

  • event β€” this is the event pointer that the Intrinsics handed to your action procedure. so, like, the pointer passed to the action procedure by the Intrinsics. that one. πŸ’–
  • modifiers_return β€” if this isn't NULL, she returns the modifiers that caused the match. if it is NULL, she just... doesn't. no biggie, we move. ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the whole tea, and you have to follow along because the conditions matter:

XtGetActionKeysym does the special thing only if all of these are true at once:

  1. she's called after an action procedure has been invoked by the Intrinsics,
  2. and before that action procedure returns,
  3. and the event pointer has the same value as the event pointer passed to that action routine,
  4. and the event is a KeyPress or KeyRelease event.

if literally all of those line up? slay. then XtGetActionKeysym returns the KeySym that matched the final event specification in the translation table. and β€” bonus β€” if modifiers_return is non-NULL, she also gives you back the modifier state actually used to generate this KeySym. periodt. πŸ’…

otherwise β€” so, if it's a KeyPress or KeyRelease event but the other conditions didn't hit β€” then XtGetActionKeysym calls XtTranslateKeycode and returns the results. she's outsourcing. respect. 🌈

and if it's neither of those situations? she returns NoSymbol, and bestie, she does not examine modifiers_return. not even a lil peek. πŸ™ˆ

fr fr, keep the event pointer matching. if the pointer doesn't have the same value as the one passed to the action routine, you're not getting the translation-table answer, no matter how much you want it. 😭

🫢 SEE ALSO 🫢

  • X Toolkit Intrinsics - C Language Interface
  • Xlib - C Language X Interface

and that's the page, angel. this one shipped with X Version 11, specifically libXt 1.3.1, and the date on the tin is the libXt 1.3.1 era β€” so go forth, grab your keysyms, and remember: same event pointer or it's giving NoSymbol. πŸ’œπŸ§šβ­

πŸ“¦ where this page comes from