[win] Support CJK input method manager (IMM)#147
Conversation
b174bd8 to
3c666dd
Compare
dacap
left a comment
There was a problem hiding this comment.
It's a good first draft, but we need to work in the API. I'll make another comment about this later.
|
The There is a comment in this member function: Lines 196 to 202 in e04e7c5 Probably we could just refactor class System {
...
virtual void setTextInput(bool state, const gfx::Point& screenCaretPos = {}) = 0;
...
}; |
72f71ad to
88dd3d9
Compare
|
@dacap It seems much easier than I thought to check if user is inputting with IME. Please have a look: The key point is to handle messages with virtual key value of |
I think the main thing is that the app (not laf) is the only one that can tell us if we are inside a text field or not, which means what we should do with this |
51ad3c5 to
1af03b2
Compare
1af03b2 to
44b9ed9
Compare
* Rename setTranslateDeadKeys() to setTextInput(). * Add a param screenCaretPos for further use in CJK input support. This function now is to indicate when we are inside a input field, and set caret position for IME positioning.
This option is default off and now for Windows only. Also adds m_isTextInputMode field to os::EventQueueWin. It will also be set in WindowWin::setTextInput().
b08c253 to
9eabe2e
Compare
It handles IME state (in a text field or not) and composition form positioning.
9eabe2e to
1248478
Compare
|
@dacap I’ve finished making the requested changes. Please take a look whenever it’s convenient. |
|
Thanks a lot for this PR @Cerallin, so far it's a good starting point to integrate in laf. I'll merge as it is and make some minor adjustments and more testing in a near future. I think we could start compiling some beta version of Aseprite with |
LAF_WITH_IME, default off, for Windows onlytranslateMessage()whenWM_KEYDOWNand if it is a virtual keysetTranslateDeadKey()tosetTextInput()for IME form positioningThe code about TranslateMessage() still needs discussion. Am I doing right?
And I would like to know if there is a good way to get the caret position, which is used for IME positioning.
I agree that my contributions are licensed under the MIT License.
You can find a copy of this license at https://opensource.org/licenses/MIT
Ref: aseprite/aseprite#1767