diff src/video/windib/SDL_dibevents.c @ 112:9ef74357a5fb

Incorporated slightly modified version of Rainer's WinCE patch
author Sam Lantinga <slouken@lokigames.com>
date Wed, 18 Jul 2001 20:04:23 +0000
parents 13ee9f4834ea
children 3c35d8f160bd
line wrap: on
line diff
--- a/src/video/windib/SDL_dibevents.c	Sat Jul 14 20:37:24 2001 +0000
+++ b/src/video/windib/SDL_dibevents.c	Wed Jul 18 20:04:23 2001 +0000
@@ -87,6 +87,26 @@
 						wParam = VK_LMENU;
 					break;
 			}
+#ifdef NO_GETKEYBOARDSTATE
+			/* this is the workaround for the missing ToAscii() and ToUnicode() in CE (not necessary at KEYUP!) */
+			if ( SDL_TranslateUNICODE ) {
+				MSG msg;
+
+				msg.hwnd = hwnd;
+				msg.message = msg;
+				msg.wParam = wParam;
+				msg.lParam = lParam;
+				msg.time = 0;
+				if ( TranslateMessage(&m) && PeekMessage(&msg, hwnd, 0, WM_USER, PM_NOREMOVE) && (m.message == WM_CHAR) ) {
+					GetMessage(&m, hwnd, 0, WM_USER);
+			    		wParam = m.wParam;
+				} else {
+					wParam = 0;
+				}
+			} else {
+				wParam = 0;
+			}
+#endif /* NO_GETKEYBOARDSTATE */
 			posted = SDL_PrivateKeyboard(SDL_PRESSED,
 				TranslateKey(wParam,HIWORD(lParam),&keysym,1));
 		}