Skip to content

Commit

Permalink
The keyboard text events should be sent after the key down events
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 16, 2013
1 parent b4b12d9 commit ff77ca8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/video/windows/SDL_windowsevents.c
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit ff77ca8

Please sign in to comment.