Fixed bug #634 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sat, 10 Oct 2009 07:30:00 +0000
branchSDL-1.2
changeset 42916cc2b35ac610
parent 4290 485868a1c283
child 4292 464126f4c7db
Fixed bug #634

If TranslateMessage() isn't done, then IME messages aren't generated.
src/video/windib/SDL_dibevents.c
src/video/windx5/SDL_dx5events.c
     1.1 --- a/src/video/windib/SDL_dibevents.c	Sat Oct 10 06:38:02 2009 +0000
     1.2 +++ b/src/video/windib/SDL_dibevents.c	Sat Oct 10 07:30:00 2009 +0000
     1.3 @@ -198,7 +198,7 @@
     1.4  				m.wParam = wParam;
     1.5  				m.lParam = lParam;
     1.6  				m.time = 0;
     1.7 -				if ( TranslateMessage(&m) && PeekMessage(&m, hwnd, 0, WM_USER, PM_NOREMOVE) && (m.message == WM_CHAR) ) {
     1.8 +				if ( PeekMessage(&m, hwnd, 0, WM_USER, PM_NOREMOVE) && (m.message == WM_CHAR) ) {
     1.9  					GetMessage(&m, hwnd, 0, WM_USER);
    1.10  			    		wParam = m.wParam;
    1.11  				}
    1.12 @@ -363,6 +363,7 @@
    1.13  
    1.14  	while ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
    1.15  		if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
    1.16 +			TranslateMessage(&msg);
    1.17  			DispatchMessage(&msg);
    1.18  		}
    1.19  	}
     2.1 --- a/src/video/windx5/SDL_dx5events.c	Sat Oct 10 06:38:02 2009 +0000
     2.2 +++ b/src/video/windx5/SDL_dx5events.c	Sat Oct 10 07:30:00 2009 +0000
     2.3 @@ -655,6 +655,7 @@
     2.4  	while ( ! posted &&
     2.5  	        PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
     2.6  		if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
     2.7 +			TranslateMessage(&msg);
     2.8  			DispatchMessage(&msg);
     2.9  		} else {
    2.10  			return(-1);
    2.11 @@ -713,12 +714,17 @@
    2.12  	}
    2.13  	if ( event != WAIT_TIMEOUT ) {
    2.14  		/* Maybe there was a windows message? */
    2.15 -		if ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
    2.16 +		posted = 0;
    2.17 +		while ( ! posted &&
    2.18 +			PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
    2.19  			if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
    2.20 +				TranslateMessage(&msg);
    2.21  				DispatchMessage(&msg);
    2.22  			} else {
    2.23  				return(-1);
    2.24  			}
    2.25 +		}
    2.26 +		if ( posted ) {
    2.27  			return(1);
    2.28  		}
    2.29  	}