* Added TranslateMessage call to SDL default message pump - was causing problems in S2 tools mode apps that used Qt. Qt relies on the WM_CHAR message generated by TranslateMessage and keyboard input was showing up in the UI as mixed-case. (Depending on which message pump got a given message - both SDL and Qt pump messages for the entire process.) Sam will review and possibly tweak this change before propagating to public SDL, but I'm checking this version in so I can integrate into S2 and fix the issue there.
authorSam Lantinga <slouken@libsdl.org>
Thu, 30 Jan 2014 12:27:00 -0800
changeset 8142 061ee02876e3
parent 8141 f3c8d96605cb
child 8143 ce90b743882a
* Added TranslateMessage call to SDL default message pump - was causing problems in S2 tools mode apps that used Qt. Qt relies on the WM_CHAR message generated by TranslateMessage and keyboard input was showing up in the UI as mixed-case. (Depending on which message pump got a given message - both SDL and Qt pump messages for the entire process.) Sam will review and possibly tweak this change before propagating to public SDL, but I'm checking this version in so I can integrate into S2 and fix the issue there.
src/video/windows/SDL_windowsevents.c
--- a/src/video/windows/SDL_windowsevents.c	Wed Jan 29 18:37:23 2014 -0800
+++ b/src/video/windows/SDL_windowsevents.c	Thu Jan 30 12:27:00 2014 -0800
@@ -550,24 +550,6 @@
         returnCode = 0;
         break;
 
-    case WM_UNICHAR:
-        {
-            if (wParam == UNICODE_NOCHAR) {
-                returnCode = 1;
-                break;
-            }
-        }
-        /* no break */
-    case WM_CHAR:
-        {
-            char text[5];
-
-            WIN_ConvertUTF32toUTF8(wParam, text);
-            SDL_SendKeyboardText(text);
-        }
-        returnCode = 0;
-        break;
-
 #ifdef WM_INPUTLANGCHANGE
     case WM_INPUTLANGCHANGE:
         {
@@ -866,6 +848,7 @@
     const Uint8 *keystate;
     MSG msg;
     while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+		TranslateMessage(&msg);
         DispatchMessage(&msg);
     }