Skip to content

Commit

Permalink
Fixed bug #634
Browse files Browse the repository at this point in the history
If TranslateMessage() isn't done, then IME messages aren't generated.
  • Loading branch information
slouken committed Oct 10, 2009
1 parent 04823fa commit fde2112
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/video/windib/SDL_dibevents.c
Expand Up @@ -198,7 +198,7 @@ LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
m.wParam = wParam;
m.lParam = lParam;
m.time = 0;
if ( TranslateMessage(&m) && PeekMessage(&m, hwnd, 0, WM_USER, PM_NOREMOVE) && (m.message == WM_CHAR) ) {
if ( PeekMessage(&m, hwnd, 0, WM_USER, PM_NOREMOVE) && (m.message == WM_CHAR) ) {
GetMessage(&m, hwnd, 0, WM_USER);
wParam = m.wParam;
}
Expand Down Expand Up @@ -363,6 +363,7 @@ void DIB_PumpEvents(_THIS)

while ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Expand Down
8 changes: 7 additions & 1 deletion src/video/windx5/SDL_dx5events.c
Expand Up @@ -655,6 +655,7 @@ static int DX5_CheckInput(_THIS, int timeout, BOOL processInput)
while ( ! posted &&
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
TranslateMessage(&msg);
DispatchMessage(&msg);
} else {
return(-1);
Expand Down Expand Up @@ -713,12 +714,17 @@ static int DX5_CheckInput(_THIS, int timeout, BOOL processInput)
}
if ( event != WAIT_TIMEOUT ) {
/* Maybe there was a windows message? */
if ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
posted = 0;
while ( ! posted &&
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
TranslateMessage(&msg);
DispatchMessage(&msg);
} else {
return(-1);
}
}
if ( posted ) {
return(1);
}
}
Expand Down

0 comments on commit fde2112

Please sign in to comment.