XMIMMBLOOKUPSTRING(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

✨ XmImMbLookupString ✨

okay bestie, welcome to the library call manual page for XmImMbLookupString πŸ’– β€” she's an input manager function that pulls a composed string out of an input method, and honestly? she's doing the most and we love her for it 🫢


🌸 NAME 🌸

XmImMbLookupString β€” an input manager function that retrieves a composed string from an input method πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <Xm/XmIm.h>
int XmImMbLookupString(
Widget widget,
XKeyPressedEvent *event,
char *buffer_return,
int bytes_buffer,
KeySym *keysym_return,
int *status_return);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea β˜• β€” XmImMbLookupString hands you back a string that got composed in the locale associated with the widget's input method, plus a KeySym that's currently mapped to the keycode in a KeyPress event. And where does that KeySym come from, you ask? The standard interpretation of Shift, Lock and Group modifiers, exactly as defined in the X Protocol specification. no cap, that's literally the spec πŸ“œ

not me having to tell you this part: an XIM will be created, but an XIC will NOT be created 😭. So one of these three functions β€” XmImSetValues, XmImVaSetValues, or XmImGetXIC β€” needs to be called to create an XIC. don't skip this step bestie, it's giving required πŸ’€

Here's the squad of arguments, one by one:

  • widget β€” specifies the ID of the widget registered with the input manager πŸ‘‘
  • event β€” specifies the key press event ⌨️
  • buffer_return β€” specifies the buffer in which the string is returned πŸ“₯
  • bytes_buffer β€” specifies the size of the buffer in bytes πŸ“
  • keysym_return β€” specifies a pointer to the KeySym returned if one exists πŸ”‘
  • status_return β€” specifies the status values returned by the function. These status values are the same as those for the XmbLookupString function ✨

And the possible status values are… (drumroll πŸ₯):

  • XBufferOverflow β€” the size of the buffer was insufficient to handle the returned string 😱. The contents of buffer_return and keysym_return are not modified. The required buffer size is returned as a value of the function. The client should repeat the call with a larger buffer size to receive the string. (like, just get a bigger buffer, it's fine 🫢)
  • XLookupNone β€” no consistent input was composed πŸ™ˆ. The contents of buffer_return and keysym_return are not modified and the function returns a value of 0.
  • XLookupChars β€” some input characters were composed and returned in buffer_return πŸ’–. The content of keysym_return is not modified. The function returns the length of the string in bytes.
  • XLookupKeysym β€” a keysym value was returned instead of a string πŸ”‘. The content of buffer_return is not modified and the function returns a value of 0.
  • XLookupBoth β€” a keysym value and a string were returned 🌈. The keysym value may not necessarily correspond to the string returned (iykyk πŸ‘€). The function returns the length of the string in bytes.

πŸ’œ RETURN πŸ’œ

Return values depend on the status returned by the function, bestie. Refer to the description of status values above ⬆️ β€” they're all up there, go look πŸ‘‘


The whole friend group πŸ«‚:


and that's the whole page, periodt πŸ’…βœ¨ this one lives in the library call manual, signed off as XmImMbLookupString(library call) β€” mwah, take care of her πŸŽ€πŸ¦‹