I18n text input
rjshaw at netspace.net.au
Tue Jan 19 00:46:20 PST 2010
Glynn Clements wrote:
> Russell Shaw wrote:
>> For functions XkbLookupKeySym(), XLookupString(), XKeycodeToKeysym(),
>> XKeysymToString etc, how can i tell if the keysym is a graphic printable
>> character like "a", or a control character such as "Left" (XK_Left) ?
>> I need to tell automatically if it's a normal unicode character that can be
>> printed in an entry box for any written language.
> For languages other than English, keyboard input isn't as simple as
> one keypress => one character. Many Western languages use "dead"
> accents (i.e. pressing an accent key causes the next character to be
> accented) or compose processing (e.g. Compose,o,/ => ø), and
> East-Asian languages typically require far more complex input methods.
>> Do these functions return UTF-8 unicode?
> XLookupString() uses ISO-8859-1.
> XmbLookupString() and XwcLookupString() return strings in a
> locale-specific encoding. If X_HAVE_UTF8_STRING is defined,
> Xutf8LookupString() returns a UTF-8 string.
I vaguely remember seeing Xutf8LookupString() years ago.
> All three functions
> require an input context (see XOpenIM() and XCreateIC() for a starting
> point, but you probably aren't going to work it out from manual pages
> Unless you're planning on spending the next few months learning how
> text entry works for languages other than English, I'd recommend using
> a GUI toolkit rather than trying to do it using bare Xlib. Or at least
> steal the code from such a toolkit.
I understand everything about non-english text entry and processing.
When i do:
XIM im = XOpenIM(app->display, NULL, NULL, NULL);
"im" is set to a valid XIM rather than NULL. I thought an input method
was supposed to be a separate process, but i haven't started one or used
one previously. Where is this one coming from? What sort of text entry
can i do with it?
More information about the xorg