* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 49ea4c7..26532d8 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -550,24 +550,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
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 @@ WIN_PumpEvents(_THIS)
const Uint8 *keystate;
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
DispatchMessage(&msg);
}