One of the first things to look into is why the current SDL 1.3 for
X11 supports just a few compose sequences but does not support all
available ones. Specifically, if you run SDL/test/checkkeys, you can
dead_acute + a = ?
dead_diaeresis + a = ?
(several more of these, but only for Latin characters; Greek, Cyrillic
would not work).
In addition, at least a handful compose sequences with the Compose key
work with the current state of SDL 1.3,
Compose + c + o = ?
Compose + o + c = ?
Compose + o + a = ?
After some long search in the SDL 1.3 source, the problem was found to
be merely with the test application.
An SDL 1.3 application simply needs to invoke setlocale() so that all
available compose sequences found in X.Org are made available.
Each application would need to 1) include locale.h and 2) invoke
setlocale() just before SDL_Init(), as shown in
One would invoke as setlocale(LC_CTYPE, “”)
- LC_CTYPE refers to character attributes and is the minimal requirement.
- One might also use LC_ALL which includes LC_CTYPE.
- “” means that the system locale is used (shown when you run
’locale’). As long as the system locale is .UTF-8, it is fine.
A typical locale would be en_US.UTF-8.
You can also try the sdlim-test application found at
http://github.com/simos/sdlim-test/ which is similar to checkkeys but
also shows the character in the window.
I verified that compose sequences from
for Latin, Greek, Cyrillic work, include exotic ones such as Compose +
( + 1 + 0 + ) (produces ?).
A number of scripts may get supported though they will not be usable
at the moment due to rendering inability with SDL_TTF.
An example of this would be Arabic/Indic scripts (characters are
joined together changing shape) and Vietnamese (for some characters
that require combining diacritics and no precomposed characters exist
in Unicode). Switching to SDL_Pango might be a solution. In any case,
we can still test the IM support even if there are issues with
What remains in the input method support in SDL 1.3 and X11 is to have
complete support for complex scripts.
A way to figure out what is required is to see similar systems, one of
which is Wine.
The task would be to get a similar support as shown in
to SDL 1.3.
I had a look at a previous project for IM support in SDL 1.2
(http://sdl-im.csie.net/) which appears to have stalled (last update
Jan’07). This project worked on X11 and Win32 IM support for SDL.
What I have been currently doing is basing the effort on sdl-im.
I have already ported part of the code to SDL 1.3,
and I plan to continue with the rest.
It would be desirable to have a sample application that implements a
simple text box.
There is some code at http://libsdlinput.sourceforge.net/ however it
would be able to have something that could be placed in SDL/test/ and
can be used for our testing purposes. If someone has such code
already, it would be welcome.
Finally, the API requirements start to become clear; there are common
functions that are shared between targets and Jiang and I have to
figure out what should those common functions be.