(svn r1907) - Fix: [ 1114261 ] Speeding up when pressing ALT+TAB (Windows)
authordarkvater
Tue, 22 Feb 2005 22:14:27 +0000
changeset 1403 aac4a4df01ac
parent 1402 033a3f3e05e0
child 1404 28fa5e4ce5e9
(svn r1907) - Fix: [ 1114261 ] Speeding up when pressing ALT+TAB (Windows)
win32.c
--- a/win32.c	Tue Feb 22 20:32:26 2005 +0000
+++ b/win32.c	Tue Feb 22 22:14:27 2005 +0000
@@ -700,13 +700,13 @@
 #else
 		if (_wnd.has_focus && GetAsyncKeyState(VK_TAB) < 0) {
 #endif
-			if (!_networking && _game_mode != GM_MENU) _fast_forward |= 2;
-		} else if (_fast_forward&2) {
+			/* 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()) */
+			if (((_pressed_key>>16) & WKC_TAB) && !_networking && _game_mode != GM_MENU) _fast_forward |= 2;
+		} else if (_fast_forward & 2)
 			_fast_forward = 0;
-		}
 
-
-		cur_ticks=GetTickCount();
+		cur_ticks = GetTickCount();
 		if ((_fast_forward && !_pause) || cur_ticks > next_tick)
 			next_tick = cur_ticks;