Page MenuHome

Update Input Method Editor support for Windows
Needs ReviewPublic

Authored by Kim Geonwoo (skyjib) on Feb 15 2020, 4:39 PM.

Details

Summary

I modified D765, D1693 to update IME support for Windows:

  1. add Korean input.
  2. add IME support in text object, console, text editor, uibutton.
  3. improve input quality.

In my test, this patch makes IME can input text like other programs supporting IME.

I'm new at making a patch, so I may have make a mistake when writing code.
But I think it can help to implement IME support.

text object:

IME in text object will show composition window on cursor to show the progress of the input.

edit:
Now this patch will only implement Korean input in button text on Windows, and improve the ime event handling method.

Diff Detail

Event Timeline

xueke pei (yuzukyo) added a comment.EditedFeb 16 2020, 4:34 AM

Thanks for the patch. Looks promising.
Blender needs a complete solution for IME on all platform, IME switch not work in MacOS for lack of developer.
@Shinsuke Irie (irie) update IME in 2018 against Blender2.8 D3058 ,the reviewed process in half way,then stop for some reason.

Maybe we need a better solution/design to support all platform IME,put all these code togather to finally get these function in master.
To achieve this goal,who use IME for input their languages need work side by side.

Thank you for letting me know D3058.
There is useful information for implementing IME I didn't know.

I can't confirm if D3058 works well.
But the code looks fine and has a better design,
So I merged D3058 into this patch and modified some code according to D3058.

Excuse me.
I want to tell you the issue that a new official commit affects this patch.
I'm newbie so I'm not sure if taking this way is good or bad to tell you this issue.

the commit:
https://github.com/blender/blender/commit/b2ee1770d4c31078518f4ec9edd5196a41345162#diff-abc98d6de3dba86b769ea32d26703be9

ARegion variables is renamed from ar to region.
some of changes of this patch is affected this commit.

Nice work! indeed this patch is truly needed for the Korean community.

There are many people saying they have hard time adopting Blender because of its vulnerability at writing Korean characters(which is used by as many as 70 MILLION people). Blender definitely needs IME on Windows. To pull more people from various countries, and to become more industry standard.

Think about it, all those potential users out there not being able to use Blender simply because they can't rename objects... Not all users are comfortable with using English all the time...

Having Korean IME support would be wonderful.

But this is a complex patch and would have to be evaluated by core devs who don't use any of the affected languages. Is it possible to simply this patch at all? For example, could your three improvements listed be done as three separate patches instead? Obviously adding Korean IME support in general is more important than having IME support for text objects, and so I wouldn't want issues around the latter complicating acceptance of the former.

I am seeing some unintended formatting changes. Ideally the changes shown should only be the changes you make. For example, the changes to "intern/ghost/CMakeLists.txt" is showing changes to 9 lines when there is only a one line addition and a one-word change. This is because the spaces of that section have been changed to tabs.

I see some changes to function names and identifiers that aren't strictly necessary, like changing "GHOST_EndIME()" to "GHOST_EndIM()", GHOST_kEventImeCompositionStart to GHOST_kEventIMCompositionStart, BLT_lang_is_ime_supported to BLT_lang_is_im_supported, etc. I realize there can be confusion and misuse of "input method" and "input method editor" but I'd rather see possible corrections like that being a separate patch so that this one shows only intentional functional changes. Similarly I see changes of "BeginIME" and "EndIME" to "EnableIME" and "DisableIME" without understanding the reasoning.

I'm guessing you created this patch with git diff > filename.diff but it would help you added more context around the changes with git diff -U100 > filename.diff. It would make the patch larger, but would still display here the same way. However, we can (optionally) see more of the code before and after your changes which can help in understanding the section you are altering.

But note that I am not a user of one of the affected languages and am not a core dev and so would not really be reviewing this. But, as mentioned, I think inclusion of Korean here is very important so I would suggest finding ways of making these changes smaller, easier to follow, and easier to review and accept.

Thank you for remembering my patch :)

Using "IM" rather than "IME" is important.
"IME" and "XIM" are used for Win32 and X11, respectively, while "IM" represents common API.
In D3058, I've tried to implement one general (platform independent) input method API, so I had to remove "IME" and "XIM" outside GHOST.

Kim Geonwoo (skyjib) edited the summary of this revision. (Show Details)

I reduced the amount of the code as possible as I can, and made some changes according to the advice.

Now, this patch will implement Korean input in button text on Windows, and improve the ime event handling method.
The code not included in this patch like generalization or typing CJK in other areas may be able to be reviewed in other revisions later, so I removed it.