Changeset - r5112:762ee2364b04
[Not reviewed]
master
0 1 0
Darkvater - 18 years ago 2006-11-17 10:06:11
darkvater@openttd.org
(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)
1 file changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
video/win32_v.c
Show inline comments
 
@@ -355,9 +355,9 @@ static LRESULT CALLBACK WndProcGdi(HWND 
 
			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 @@ static void Win32GdiMainLoop(void)
 
	for (;;) {
 
		while (PeekMessage(&mesg, NULL, 0, 0, PM_REMOVE)) {
 
			InteractiveRandom(); // randomness
 
			TranslateMessage(&mesg);
 
			DispatchMessage(&mesg);
 
		}
 
		if (_exit_game) return;
0 comments (0 inline, 0 general)