summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-11-17 10:06:11 +0000
committerDarkvater <Darkvater@openttd.org>2006-11-17 10:06:11 +0000
commitcfd1c826d762b2012bf98727bec777848a5a8b56 (patch)
treea33936cb1255a943998f620c3773c1bee5c61982 /video
parent7d497f2b01a20e5d3aeec3f9ff47b2ba0abc26d4 (diff)
downloadopenttd-cfd1c826d762b2012bf98727bec777848a5a8b56.tar.xz
(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)
Diffstat (limited to 'video')
-rw-r--r--video/win32_v.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/video/win32_v.c b/video/win32_v.c
index 7511df597..9381e8b5f 100644
--- a/video/win32_v.c
+++ b/video/win32_v.c
@@ -355,9 +355,9 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
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;