blender/intern/ghost
Yuki Hashimoto 0ef794b553 macOS: support Chinese and Korean input for text buttons
This patch extends D11695 to provide full support for Chinese and Korean
input on macOS.

Chinese input notes:

You can input symbolic characters (such as '! , '$') during 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`.

Korean input notes:

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:
1. press g ㅎ (`setMarkedText`)
2. press k 하 (`setMarkedText`)
3. press t 앗 (`setMarkedText`)
4. 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.

Differential Revision: https://developer.blender.org/D11699
2021-07-05 17:24:34 +02:00
..
intern macOS: support Chinese and Korean input for text buttons 2021-07-05 17:24:34 +02:00
test Cleanup: spelling in comments 2021-07-02 12:15:29 +10:00
CMakeLists.txt macOS: support Japanese input for text buttons 2021-07-05 17:24:27 +02:00
GHOST_C-api.h Cleanup: spelling in comments 2021-07-02 12:15:29 +10:00
GHOST_IContext.h Cleanup: doxygen comments in ghost 2020-11-06 14:25:44 +11:00
GHOST_IEvent.h Code Style: use "#pragma once" in intern/ghost 2020-08-07 10:18:01 +02:00
GHOST_IEventConsumer.h Cleanup: doxygen comments in ghost 2020-11-06 14:25:44 +11:00
GHOST_ISystem.h Cleanup: doxygen comments in ghost 2020-11-06 14:25:44 +11:00
GHOST_ISystemPaths.h Cleanup: full sentences in comments, improve comment formatting 2021-06-26 21:50:48 +10:00
GHOST_ITimerTask.h Cleanup: doxygen comments in ghost 2020-11-06 14:25:44 +11:00
GHOST_IWindow.h Cleanup: doxygen comments in ghost 2020-11-06 14:25:44 +11:00
GHOST_IXrContext.h XR Controller Support Step 1: Internal Abstractions for OpenXR Actions 2021-05-16 03:36:31 +09:00
GHOST_Path-api.h Ghost: Support queries for special user directories (desktop, documents, etc.) 2020-12-11 16:20:53 +01:00
GHOST_Rect.h Cleanup: doxygen comments in ghost 2020-11-06 14:25:44 +11:00
GHOST_Types.h Cleanup: comment use C comment-blocks for GHOST_Types.h 2021-06-22 14:23:37 +10:00