Open shakesoda opened 8 years ago
I'd probably accept a pull request for this, but I really have no experience with IME and wouldn't even know how to test if it's working properly.
I'd probably lean toward leaving the functionality out for 0.9.2 rather than hacking it in; so far the Love stuff is "pure" and doesn't rely on any FFI/SDL.
See love's textedited event, which is totally undocumented. The attached code is probably the most complete example of its usage that exists. SDL backend will be exactly the same, since love's functions don't do much of anything extra.
Compose events are used for some other cases that aren't CJK as well, but I think only CJK languages use candidate lists.
Love 0.9.2 doesn't actually include everything needed for proper IME support unless you FFI in l.k.setTextInput with additional arguments and update SDL.
(the unabridged version of the following code is here. You may want to look at draw(), and you'll want to ensure that start_editing is called every time the contents change)