From ff77ca8d0b2ead8729b8463c335394a28dfc2806 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 16 Aug 2013 15:38:06 -0700 Subject: [PATCH] The keyboard text events should be sent after the key down events --- src/video/windows/SDL_windowsevents.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index eb57bcdb7..a40be7b38 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -487,7 +487,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) #endif /* WM_MOUSELEAVE */ case WM_KEYDOWN: + case WM_SYSKEYDOWN: { + SDL_Scancode code = WindowsScanCodeToSDLScanCode( lParam, wParam ); + if ( code != SDL_SCANCODE_UNKNOWN ) { + SDL_SendKeyboardKey(SDL_PRESSED, code ); + } + } + if (msg == WM_KEYDOWN) { BYTE keyboardState[256]; char text[5]; UINT32 utf32 = 0; @@ -501,14 +508,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } } } - // no break - case WM_SYSKEYDOWN: - { - SDL_Scancode code = WindowsScanCodeToSDLScanCode( lParam, wParam ); - if ( code != SDL_SCANCODE_UNKNOWN ) { - SDL_SendKeyboardKey(SDL_PRESSED, code ); - } - } returnCode = 0; break;