I’ve been having some inquiries from CJK players of my SDL2-based game on Windows, asking about IME text entry; the candidate list window simply doesn't appear for them, making it impossible (or very difficult) to type certain glyph compositions. Right now I’m using the current latest SDL2, version 2.0.12.
As far as I can tell, I’m doing everything in approximately the right way; calling SDL_StartTextInput() when keyboard focus is moved to an (in-game-rendered) editable text field, and SDL_StopTextInput() when the keyboard focus leaves it, as well as setting SDL_SetTextInputRect() to tell the OS where the text field is. SDL_TEXTINPUT and SDL_TEXTEDITING events seem to come through the event loop as they're documented to do; everything seems to be working, except that the candidate list window doesn't open.
And it all works exactly correctly in Linux and Mac builds, with IME candidate list windows popping up at the right times and right places and functioning correctly to allow entry of composed CJK unicode glyphs, on those OSes. It's only on Windows where the candidate list window just never opens, which is a big problem for a bunch of my players. Does anybody know how one is intended to handle IME compositions under SDL2 on Windows? (I'm doing all of this testing with Windows 10's default IMEs for Japanese and Simplified Chinese)
Can anybody fill me in on how the system is intended to be used? The tutorial page on input methods is really thin on details, and I can’t find a real demo program which shows how IME is actually intended to be handled in SDL2, or I’d just copy what they were doing.
May or may not be relevant, but my game is an OpenGL 3.3 game, using SDL for window management, input, and cross-platform multithreading support; we’re not using SDL’s built-in renderer at all.
EDIT:
I’ve put a minimal example program over here on GitHub, demonstrating what I’m seeing. It’s just fifty lines of C code, so if I’m doing something catastrophically silly, it should hopefully be pretty easy to spot!