From be83e1a33fa7cdbaeedf9de1b1cf4180e94caf40 Mon Sep 17 00:00:00 2001 From: Chanwoong Kim Date: Tue, 1 Mar 2016 22:54:52 +0900 Subject: [PATCH] Show Korean IME --- src/platform/shared.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/shared.c b/src/platform/shared.c index f7b770c83d..3c35dd975d 100644 --- a/src/platform/shared.c +++ b/src/platform/shared.c @@ -702,10 +702,11 @@ void platform_process_messages() } break; case SDL_TEXTEDITING: - safe_strcpy(gTextInputComposition, e.edit.text, min(e.edit.length, 32)); + // When inputting Korean characters, `e.edit.length` is always Zero. + safe_strcpy(gTextInputComposition, e.edit.text, min((e.edit.length == 0) ? (strlen(e.edit.text)+1) : e.edit.length, 32)); gTextInputCompositionStart = e.edit.start; gTextInputCompositionLength = e.edit.length; - gTextInputCompositionActive = gTextInputComposition[0] != 0; + gTextInputCompositionActive = ((e.edit.length != 0 || strlen(e.edit.text) != 0) && gTextInputComposition[0] != 0); break; case SDL_TEXTINPUT: if (gTextInputLength < gTextInputMaxLength && gTextInput){