XmbLookupString(3)
π XmbLookupString(3) β XLIB FUNCTIONS energy, fr fr π
β¨ NAME β¨
XmbLookupString, XwcLookupString, Xutf8LookupString β obtain composed input from an input method. Thatβs the whole vibe, bestie. π
π SYNTAX π
Okay so here are the signatures, exactly as they are, no edits:
int XmbLookupString(XIC ic, XKeyPressedEvent *event, char
*buffer_return, int bytes_buffer, KeySym *keysym_return, Status
*status_return);
int XwcLookupString(XIC ic, XKeyPressedEvent *event, wchar_t
*buffer_return, int wchars_buffer, KeySym *keysym_return, Status
*status_return);
int Xutf8LookupString(XIC ic, XKeyPressedEvent *event, char
*buffer_return, int bytes_buffer, KeySym *keysym_return, Status
*status_return);
π¦ ARGUMENTS π¦
buffer_returnβ returns a multibyte string or wide character string (if any) from the input method. Itβs giving βhereβs your text, maybeβ. πbytes_bufferandwchars_bufferβ specifies space available in the return buffer. Like, how much room youβre giving it. π«Άeventβ specifies the key event to be used.icβ specifies the input context.keysym_returnβ returns the KeySym computed from the event if this argument is notNULL.status_returnβ returns a value indicating what kind of data is returned. Check this before you trust the other returns, okay? π
πΈ DESCRIPTION πΈ
The XmbLookupString, XwcLookupString and Xutf8LookupString functions return the string from the input method specified in the buffer_return argument. If no string is returned, the buffer_return argument is unchanged. No cap.
The KeySym into which the KeyCode from the event was mapped is returned in the keysym_return argument if it is non-NULL and the status_return argument indicates that a KeySym was returned. If both a string and a KeySym are returned, the KeySym value does not necessarily correspond to the string returned. iykyk. π
XmbLookupString and Xutf8LookupString return the length of the string in bytes, and XwcLookupString returns the length of the string in characters. Both XmbLookupString and XwcLookupString return text in the encoding of the locale bound to the input method of the specified input context, and Xutf8LookupString returns text in UTF-8 encoding. Encoding tea, periodt. π΅
Each string returned by XmbLookupString and XwcLookupString begins in the initial state of the encoding of the locale (if the encoding of the locale is state-dependent).
β οΈ Note: To ensure proper input processing, it is essential that the client pass onlyKeyPressevents toXmbLookupString,XwcLookupStringandXutf8LookupString. Their behavior when a client passes aKeyReleaseevent is undefined. Like, literally undefined β donβt test it, bestie. π
Clients should check the status_return argument before using the other returned values. These three functions each return a value to status_return that indicates what has been returned in the other arguments. The possible values returned are:
XBufferOverflowβ The input string to be returned is too large for the suppliedbuffer_return. The required size (forXmbLookupString,Xutf8LookupStringin bytes; forXwcLookupStringin characters) is returned as the value of the function, and the contents ofbuffer_returnandkeysym_returnare not modified. The client should recall the function with the same event and a buffer of adequate size to obtain the string.XLookupNoneβ No consistent input has been composed so far. The contents ofbuffer_returnandkeysym_returnare not modified, and the function returns zero.XLookupCharsβ Some input characters have been composed. They are placed in thebuffer_returnargument, using the encoding described above, and the string length is returned as the value of the function. The content of thekeysym_returnargument is not modified.XLookupKeySymβ A KeySym has been returned instead of a string and is returned inkeysym_return. The content of thebuffer_returnargument is not modified, and the function returns zero.XLookupBothβ Both a KeySym and a string are returned;XLookupCharsandXLookupKeySymoccur simultaneously.
It does not make any difference if the input context passed as an argument to XmbLookupString, XwcLookupString and Xutf8LookupString is the one currently in possession of the focus or not. Input may have been composed within an input context before it lost the focus, and that input may be returned on subsequent calls to XmbLookupString, XwcLookupString or Xutf8LookupString even though it does not have any more keyboard focus. Main character energy: it can still show up after the focus leaves. β¨
The function Xutf8LookupString is an extension introduced by The XFree86 Project, Inc., in their 4.0.2 release. Its presence is indicated by the macro X_HAVE_UTF8_STRING. π«Ά
π SEE ALSO π
XLookupKeysym(3)Compose(5)Xlib - C Language X Interface
π Thatβs the sign-off, bestie β footer source/version flex: X Version 11 Β· libX11 1.8.14. Bye! π
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms