From aaa8cb5a37a720ff67792d0a31fec793b03b3742 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 29 Jan 2024 17:42:38 +0800 Subject: 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. --- indra/newview/llviewerwindow.cpp | 8 ++++++++ indra/newview/llviewerwindow.h | 1 + 2 files changed, 9 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ed671fe849..405da33bdf 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3129,6 +3129,14 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask) return FALSE; } +BOOL LLViewerWindow::handleUnicodeString(char *uni_str) +{ + auto keyboard_focus = gFocusMgr.getKeyboardFocus(); + if (keyboard_focus) + keyboard_focus->handleUnicodeString(uni_str, FALSE); + + return TRUE; +} void LLViewerWindow::handleScrollWheel(S32 clicks) { diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ccef006a07..fe20b5fa23 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -192,6 +192,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); // NOT going to handle extended + /*virtual*/ BOOL handleUnicodeString(char *uni_str); /*virtual*/ BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleCloseRequest(LLWindow *window); -- cgit v1.2.3