Hello everyone, I have noticed that Blender has support for IME (Input Method Editor) in the Windows platform, but there are still many issues.
I have attempted to improve Blender’s support for IME in Windows and have already completed the modifications.
Note: Just for Windows. I am not familiar with Linux and macOS.
This branch is only for development purposes. It will output debugging information on the console.
The following video provides a quick preview of the comparison before and after modifications:
It can solve these problems:
#84081, #89831, 93421, #96696, #112119, #122469
I am not a proficient C & C++ developer, so the code style may not be good.
But I am preparing to start a Pull Request, but I have some questions that I would like to consult.
-
This modification involves three potentially significant changes:
a. After the IME is enabled, key messages will be processed in WM_KEYDOWN instead of WM_INPUT.
To support IME, it is necessary to know whether a key has been processed by the IME. This information can only be obtained through WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP, not WM_INPUT.
At present, Blender only handles WM_INPUT and ignores WM_KEYDOWN, resulting in various issues when using IME.
What I want to ask is, is there any special reason why Blender ignores WM_KEYDOWN?
b. GHOST_ImeWin32 is changed so much
This class comes from an old version of Chromium, which is outdated. To solve the current problem, it needs to be adjusted.
I personally think that the modifications made to it are not very significant, only removing some useless features and improving some functions.
But I’m not sure if this can be considered a major change from the perspective of Blender developers.
c. A new callback function has been added to
ARegionType
.Because it is necessary to track changes in region focus to enable or disable IME in real time, a callback function
on_activation_changed
has been added toARegionType
.When the focus changes (
ED_screen_set_active_region
), the region will receive a notification.Does this design conform to Blender’s design?
-
Should I split this modification into multiple pull request?
Partial modifications can be separated, but they are all centered around the IME. Should I split them into multiple pull requests or just a single one?