SDL 2.0 text input

Hello everybody,
I wrote a small program using SDL 2.0 and SDL_ttf to understand how
the new text input API worked and I thought someone might find it
useful or might want to put it on the documentation wiki, so here it
is as an attachment. However, I still have one unanswered question
about these new functions : what does SDL_SetTextInputRect do exactly
?
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl_textinput_example.c
Type: text/x-csrc
Size: 4680 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120905/baa5902a/attachment.c

Hi,On Wed, Sep 5, 2012 at 1:25 AM, Nguyen Thanh Dung wrote:

Hello everybody,
I wrote a small program using SDL 2.0 and SDL_ttf to understand how
the new text input API worked and I thought someone might find it
useful or might want to put it on the documentation wiki, so here it
is as an attachment. However, I still have one unanswered question
about these new functions : what does SDL_SetTextInputRect do exactly
?

Some text input methods will show a candidate text box for you to choose
which character you want to input. This candidate box is best shown near
the position of the text you are currently inputing. This function is
supposed to give those text input methods a hint about where the location
is.

  • Jiang

Jiang Jiang :

Hi,

Hello everybody,
I wrote a small program using SDL 2.0 and SDL_ttf to understand how
the new text input API worked and I thought someone might find it
useful or might want to put it on the documentation wiki, so here it
is as an attachment. However, I still have one unanswered question
about these new functions : what does SDL_SetTextInputRect do exactly
?

Some text input methods will show a candidate text box for you to choose
which character you want to input. This candidate box is best shown near
the position of the text you are currently inputing. This function is
supposed to give those text input methods a hint about where the location
is.

So the method basically is for IME functionality? If so, would not it make
sense to name it that way to clearly outline that this does not limit the
text input area in some way, but rather is for supportive input method
systems?
How about SDL_SetIMEInputRect() instead? This would solve a lot of confusion
about the function. Especially since the documentation of the function
"Set the rectangle used to type Unicode text inputs." is not a help at all.

Cheers
Marcus> On Wed, Sep 5, 2012 at 1:25 AM, Nguyen Thanh Dung wrote: