diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-01-29 17:42:38 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-01-30 12:06:48 +0800 |
commit | aaa8cb5a37a720ff67792d0a31fec793b03b3742 (patch) | |
tree | 734ce89b2f133f1fd55cd04e5e79eb5c1ed06d50 /indra/llwindow | |
parent | 4c97df0ab1b450d5680975e18e894b6676a589ee (diff) |
First attempt to fix unicode input
It should work well enough with most, but on Japanese (I assume all CJK),
for now the composition part is still left printed out along with the result
(as opposed to just replaced by the result). It's to be fixed next.
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowcallbacks.cpp | 4 | ||||
-rw-r--r-- | indra/llwindow/llwindowcallbacks.h | 1 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 8 |
3 files changed, 10 insertions, 3 deletions
diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp index be61e1e16c..343ec5f9f7 100644 --- a/indra/llwindow/llwindowcallbacks.cpp +++ b/indra/llwindow/llwindowcallbacks.cpp @@ -52,6 +52,10 @@ BOOL LLWindowCallbacks::handleUnicodeChar(llwchar uni_char, MASK mask) return FALSE; } +BOOL LLWindowCallbacks::handleUnicodeString(char *uni_str) +{ + return FALSE; +} BOOL LLWindowCallbacks::handleMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask) { diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h index 3b18648138..2a9fcf402a 100644 --- a/indra/llwindow/llwindowcallbacks.h +++ b/indra/llwindow/llwindowcallbacks.h @@ -37,6 +37,7 @@ public: virtual BOOL handleTranslatedKeyUp(KEY key, MASK mask); virtual void handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level); virtual BOOL handleUnicodeChar(llwchar uni_char, MASK mask); + virtual BOOL handleUnicodeString(char *uni_str); virtual BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); virtual BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 106109ceff..bbc966fb25 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1893,9 +1893,11 @@ void LLWindowSDL::gatherInput() break; case SDL_TEXTINPUT: - mKeyVirtualKey = *event.text.text; - handleUnicodeUTF16(mKeyVirtualKey, - gKeyboard->currentMask(FALSE)); + mCallbacks->handleUnicodeString(event.text.text); + break; + + case SDL_TEXTEDITING: + mCallbacks->handleUnicodeString(event.edit.text); break; case SDL_KEYUP: |