(svn r7187) -CodeChange: [win32] Limit success of ToUnicode/ToAscii to only one translated character as we only support one and remove TranslateMessage() call since we do not use it anyways (glx)
authorDarkvater
Fri, 17 Nov 2006 10:06:11 +0000
changeset 5112 9bb62a7fc166
parent 5111 05bb05c1e9b5
child 5113 5626f4b8b46e
(svn r7187) -CodeChange: [win32] Limit success of ToUnicode/ToAscii to only one translated character as we only support one and remove TranslateMessage() call since we do not use it anyways (glx)
video/win32_v.c
--- a/video/win32_v.c	Fri Nov 17 07:46:02 2006 +0000
+++ b/video/win32_v.c	Fri Nov 17 10:06:11 2006 +0000
@@ -355,9 +355,9 @@
 			uint32 pressed_key;
 
 			GetKeyboardState(ks);
-			if (ToUnicode(wParam, 0, ks, &w, 1, 0) == 0) {
+			if (ToUnicode(wParam, 0, ks, &w, 1, 0) != 1) {
 				/* On win9x ToUnicode always fails, so fall back to ToAscii */
-				if (ToAscii(wParam, 0, ks, &w, 0) == 0) w = 0; // no translation was possible
+				if (ToAscii(wParam, 0, ks, &w, 0) != 1) w = 0; // no translation was possible
 			}
 
 			pressed_key = w | MapWindowsKey(wParam) << 16;
@@ -787,7 +787,6 @@
 	for (;;) {
 		while (PeekMessage(&mesg, NULL, 0, 0, PM_REMOVE)) {
 			InteractiveRandom(); // randomness
-			TranslateMessage(&mesg);
 			DispatchMessage(&mesg);
 		}
 		if (_exit_game) return;