mirror of https://github.com/OpenTTD/OpenTTD
(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)
parent
8a49fa12ff
commit
590e90cd9e
|
@ -355,9 +355,9 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
uint32 pressed_key;
|
uint32 pressed_key;
|
||||||
|
|
||||||
GetKeyboardState(ks);
|
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 */
|
/* 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;
|
pressed_key = w | MapWindowsKey(wParam) << 16;
|
||||||
|
@ -787,7 +787,6 @@ static void Win32GdiMainLoop(void)
|
||||||
for (;;) {
|
for (;;) {
|
||||||
while (PeekMessage(&mesg, NULL, 0, 0, PM_REMOVE)) {
|
while (PeekMessage(&mesg, NULL, 0, 0, PM_REMOVE)) {
|
||||||
InteractiveRandom(); // randomness
|
InteractiveRandom(); // randomness
|
||||||
TranslateMessage(&mesg);
|
|
||||||
DispatchMessage(&mesg);
|
DispatchMessage(&mesg);
|
||||||
}
|
}
|
||||||
if (_exit_game) return;
|
if (_exit_game) return;
|
||||||
|
|
Loading…
Reference in New Issue