This patch includes D11695.
I would appreciate it if you could check D11695 first.
Problem
D11695 did not include full support for Chinese and Korean.
This patch adds code to D11695 to provide full support for Chinese and Korean input on the Mac.
- You can input symbolic characters (such as '! , '$') during Chinese input.
- Full support for Korean input.
New
Technical Note:
This section describes Chinese input.
The difference from Japanese input is that multiple insertText may be called with a single key down (keyDown method).
This happens when you input a symbolic character (such as '! , '$') during conversion.
The conversion is confirmed (insertText) and the symbolic character is entered (insertText).
To solve this problem, I have result_text to concatenate the strings and store them in result.
This section explains the Korean language input.
Korean does not display a conversion suggestion window.
Like Chinese, Korean input may call multiple insertText methods.
Also, in Korean, the previous confirmation (setMarkedText and insertText) and the next conversion is processed (setMarkedText) may be called simultaneously with a single key down (keyDown method).
For example,
- press g ㅎ (setMarkedText)
- press k 하 (setMarkedText)
- press t 앗 (setMarkedText)
- press k 하세 (setMarkedText, insertText, setMarkedText)
Fixed so that the insertText and the last setMarkedText are processed.
Also, if a control character (such as Arrow, Enter) is input during Korean input, the conversion will be confirmed (setMarkedText, insertText) and the original control character will be processed.
In other words, if you press the left arrow key while typing in Korean, the cursor will move to the left after the character is confirmed.
Therefore, I modified the keyDown method so that the handleKeyEvent is called again after the insertText is processed in the interpretKeyEvents method.