(svn r2052) - Fix Regression: ALT+F4 once again shuts down openttd in windows and F10, etc. is fixed.

This commit is contained in:
darkvater 2005-03-24 20:47:21 +00:00
parent 6c08d459d6
commit 877a9f7df7

12
win32.c
View File

@ -330,9 +330,12 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return 0; return 0;
case VK_MENU: /* Just ALT */ case VK_MENU: /* Just ALT */
return 0; // do nothing return 0; // do nothing
default: /* ALT in combination with something else */ case VK_F10: /* F10, ignore activation of menu */
_pressed_key = MapWindowsKey(wParam) << 16; _pressed_key = MapWindowsKey(wParam) << 16;
return 0; return 0;
default: /* ALT in combination with something else */
_pressed_key = MapWindowsKey(wParam) << 16;
break;
} }
break; break;
case WM_NCMOUSEMOVE: case WM_NCMOUSEMOVE:
@ -711,13 +714,14 @@ static int Win32GdiMainLoop(void)
#if defined(_DEBUG) #if defined(_DEBUG)
if (_wnd.has_focus && GetAsyncKeyState(VK_SHIFT) < 0) { if (_wnd.has_focus && GetAsyncKeyState(VK_SHIFT) < 0) {
if (
#else #else
if (_wnd.has_focus && GetAsyncKeyState(VK_TAB) < 0) { if (_wnd.has_focus && GetAsyncKeyState(VK_TAB) < 0) {
#endif
/* Disable speeding up game with ALT+TAB (if syskey is pressed, the /* Disable speeding up game with ALT+TAB (if syskey is pressed, the
* real key is in the upper 16 bits (see WM_SYSKEYDOWN in WndProcGdi()) */ * real key is in the upper 16 bits (see WM_SYSKEYDOWN in WndProcGdi()) */
if ((_pressed_key >> 16) & WKC_TAB && !_networking && if ((_pressed_key >> 16) & WKC_TAB &&
_game_mode != GM_MENU) #endif
!_networking && _game_mode != GM_MENU)
_fast_forward |= 2; _fast_forward |= 2;
} else if (_fast_forward & 2) } else if (_fast_forward & 2)
_fast_forward = 0; _fast_forward = 0;