XtGetKeysymTable(3)

✨ XtGetKeysymTable(3) ✨

okay bestie, we're in the XT FUNCTIONS section of the manual, and today's episode is querying keysyms and keycodes πŸ’… like, the keyboard lore, the mapping tea. let's get into it 🫢


🌸 NAME 🌸

XtGetKeysymTable, XtKeysymToKeycodeList β€” query keysyms and keycodes πŸ”₯


πŸŽ€ SYNTAX πŸŽ€

#include <X11/Intrinsic.h>

KeySym* XtGetKeysymTable(Display* display, KeyCode* min_keycode_return,
       int *keysyms_per_keycode_return);

void XtKeysymToKeycodeList(Display* display, KeySym keysym, KeyCode**
       keycodes_return, Cardinal* keycount_return);

literally copy these exact signatures into your code, no cap, don't freestyle the types πŸ’€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • display β€” tells us which display's table we're asking about. it's giving "which screen, bestie?" ✨
  • min_keycode_return β€” on the way out, this holds the smallest KeyCode that's valid for the display. returns it to you 🎁
  • keysyms_per_keycode_return β€” on the way out, this holds how many KeySyms are stored for each KeyCode. yeah, each keycode can have a lil squad of keysyms πŸ‘‘
  • keysym β€” the KeySym you're hunting for. the one we're searching πŸ”
  • keycodes_return β€” on the way out, this is a list of the KeyCodes that have keysym associated with them. or NULL if keycount_return is 0 πŸ«₯
  • keycount_return β€” on the way out, this is how many KeyCodes are in that list. the count, the receipts, the number πŸ“Š

πŸ’– DESCRIPTION πŸ’–

XtGetKeysymTable hands you back a pointer to the Intrinsics' own copy of the server's KeyCode-to-KeySym table. it's the table, the whole vibe check of your keyboard mapping.

⚠️ bestie, listen: this table must not be modified. do not touch. do not edit. hands off. it's not yours, it's the Intrinsics', and messing with it is not the move πŸ™ˆ periodt.

XtKeysymToKeycodeList is the other one β€” it returns all the KeyCodes that have keysym sitting in their entry for the keyboard mapping table associated with display. like, every single keycode that reps that keysym 🌈

and then, when you're done with it, the caller should free the storage that keycodes_return points to, using XtFree. yes, that's on you. clean up after yourself, queen πŸ§ΉπŸ’…


🌟 SEE ALSO 🌟

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

and that's the whole page, bestie!! πŸŽ€βœ¨ this one's from X Version 11, libXt 1.3.1 β€” shoutout to the libXt girlies keeping your keyboard mappings iconic since forever πŸ‘‘ mwah, go free your keycodes_return storage πŸ’–πŸ¦‹

πŸ“¦ where this page comes from