Document Michael's changes adding TranslateMessage() back to the SDL message loop.
authorSam Lantinga <slouken@libsdl.org>
Thu, 30 Jan 2014 12:27:24 -0800
changeset 8143 ce90b743882a
parent 8142 061ee02876e3
child 8144 855b1d6d7d8e
Document Michael's changes adding TranslateMessage() back to the SDL message loop.
src/video/windows/SDL_windowsevents.c
--- a/src/video/windows/SDL_windowsevents.c	Thu Jan 30 12:27:00 2014 -0800
+++ b/src/video/windows/SDL_windowsevents.c	Thu Jan 30 12:27:24 2014 -0800
@@ -550,6 +550,12 @@
         returnCode = 0;
         break;
 
+    case WM_UNICHAR:
+    case WM_CHAR:
+        /* Ignore WM_CHAR messages that come from TranslateMessage(), since we handle WM_KEY* messages directly */
+        returnCode = 0;
+        break;
+
 #ifdef WM_INPUTLANGCHANGE
     case WM_INPUTLANGCHANGE:
         {
@@ -848,7 +854,8 @@
     const Uint8 *keystate;
     MSG msg;
     while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
-		TranslateMessage(&msg);
+        /* Always translate the message in case it's a non-SDL window (e.g. with Qt integration) */
+        TranslateMessage(&msg);
         DispatchMessage(&msg);
     }