XtSetKeyTranslator(3)
π XtSetKeyTranslator β the XT FUNCTIONS girlies π
okay bestie, so this is the XtSetKeyTranslator(3) page from the XT FUNCTIONS manual, and it's literally all about turning KeySym into KeyCodes π¦β¨. Sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
XtSetKeyTranslator, XtTranslateKeycode, XtRegisterCaseConverter, XtConvertCase β convert KeySym to KeyCodes π
πΈ SYNTAX πΈ
#include <X11/Intrinsic.h>
void XtSetKeyTranslator(Display *display, XtKeyProc proc);
void XtTranslateKeycode(Display *display, KeyCode keycode, Modifiers
modifiers, Modifiers *modifiers_return, KeySym *keysym_return);
void XtRegisterCaseConverter(Display *display, XtCaseProc proc, KeySym
start, KeySym stop);
void XtConvertCase(Display *display, KeySym keysym, KeySym
*lower_return, KeySym *upper_return);
π ARGUMENTS π
displayβ the display, obviously. the whole vibe check happens here πkeycodeβ the KeyCode you wanna translate, no cap.keysymβ the KeySym you're converting, periodt.keysym_returnβ this one hands you back the resulting KeySym π«Άlower_returnβ gives you back the lowercase equivalent of the KeySym πupper_returnβ gives you back the UPPERCASE equivalent, loud and proud π₯modifiersβ the modifiers attached to that KeyCode.modifiers_returnβ returns a mask showing which modifiers were actually used to generate the KeySym. receipts!! π§Ύprocβ the procedure that's gonna do the key translating or the converting, your choice bestie.startβ the first KeySym this converter is valid for.stopβ the last KeySym this converter is valid for. yes queen, it's a range π
π DESCRIPTION π
So XtSetKeyTranslator does the thing where it sets the procedure you gave it as the current key translator. That's it, that's the function. π
The default translator is XtTranslateKey, which is an XtKeyProc that uses Shift and Lock modifiers, with the interpretations defined by the core protocol. It's literally provided so that brand-new translators can call it to get the default KeyCode-to-KeySym translations, and also so the default translator can be reinstalled if you ever need to bring her back. main character energy fr fr π
XtTranslateKeycode is the chill one β it just passes the arguments you gave it directly to whatever KeyCode-to-KeySym translator is currently registered. no middleman, no drama π¦
XtRegisterCaseConverter registers the case converter you specified. The start and stop arguments give the inclusive range of KeySyms that this converter gets called for. Heads up though β the new converter overrides any previous converters for KeySyms in that range. π
and here's the tea bestie: no interface exists to remove converters. like, none. zero. you literally have to register an identity converter if you want one gone. that's the only way. π
When a new converter gets registered, the Intrinsics refreshes the keyboard state if necessary. The default converter understands case conversion for all the KeySyms defined in the core protocol. slay β¨
And XtConvertCase calls the appropriate converter and returns the results. lowkey important: a user-supplied XtKeyProc may need to use this function, so don't forget about her π«Ά
π SEE ALSO π
- X Toolkit Intrinsics - C Language Interface
- Xlib - C Language Interface
and that's the whole page, bestie!! π this was X Version 11, libXt 1.3.1, and it's XtSetKeyTranslator(3) forever and always. go convert some keysyms, ily, bye πβ¨π¦πΈ
π¦ where this page comes from
- alpine 3.22: libxt-doc 1.3.1-r0 Β· MIT
- alpine 3.23: libxt-doc 1.3.1-r0 Β· MIT
- alpine 3.24: libxt-doc 1.3.1-r0 Β· MIT
- arch rolling: libxt 1.3.1-1 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 43: libXt-devel 1.3.1-3.fc43 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 43: libXt-devel 1.3.1-3.fc43 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 44: libXt-devel 1.3.1-4.fc44 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 44: libXt-devel 1.3.1-4.fc44 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- Copyright 1993 X Consortium
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms