about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDominik Geyer <dominik.geyer@gmx.de>2008-10-15 13:10:41 +0000
committerDominik Geyer <dominik.geyer@gmx.de>2008-10-15 13:10:41 +0000
commitcae288fa728aa8cfe29f2fdebe6b329e60b07691 (patch)
tree2a8112934e0b7616bca894da72255a6b424acc71
parent051ed0c892676e8354e8709fe3121c1fcc880939 (diff)
downloadzcatch-cae288fa728aa8cfe29f2fdebe6b329e60b07691.tar.gz
zcatch-cae288fa728aa8cfe29f2fdebe6b329e60b07691.zip
debugging: release input-focus when hotkey ESC is pressed (and dbg_focus var is set); avoids the need for ALT-TAB while debugging
-rw-r--r--src/engine/client/ec_client.c8
-rw-r--r--src/game/variables.hpp1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c
index cdcbf12a..ef0a25af 100644
--- a/src/engine/client/ec_client.c
+++ b/src/engine/client/ec_client.c
@@ -1542,14 +1542,20 @@ static void client_run()
 			perf_end();
 		}
 		
-		/* refocus */
+		/* release focus */
 		if(!gfx_window_active())
 		{
 			if(window_must_refocus == 0)
 				inp_mouse_mode_absolute();
 			window_must_refocus = 1;
 		}
+		else if (config.dbg_focus && inp_key_pressed(KEY_ESC))
+		{
+			inp_mouse_mode_absolute();
+			window_must_refocus = 1;
+		}
 
+		/* refocus */
 		if(window_must_refocus && gfx_window_active())
 		{
 			if(window_must_refocus < 3)
diff --git a/src/game/variables.hpp b/src/game/variables.hpp
index 1928d1b7..cd738bf3 100644
--- a/src/game/variables.hpp
+++ b/src/game/variables.hpp
@@ -37,6 +37,7 @@ MACRO_CONFIG_INT(dbg_dummies, 0, 0, 11)
 MACRO_CONFIG_INT(dbg_firedelay, 0, 0, 1)
 MACRO_CONFIG_INT(dbg_flow, 0, 0, 1)
 MACRO_CONFIG_INT(dbg_tuning, 0, 0, 1)
+MACRO_CONFIG_INT(dbg_focus, 0, 0, 1)
 
 MACRO_CONFIG_INT(ui_page, 5, 0, 9)
 MACRO_CONFIG_STR(ui_server_address, 128, "localhost:8303")