about summary refs log tree commit diff
path: root/src/game/client/components/binds.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-30 09:34:55 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-30 09:34:55 +0000
commit2b53f91a1f24dfba2837b458177042efd48260cd (patch)
treeb17edbe2f832c5ea3a1e0a831ddff4409ea87a49 /src/game/client/components/binds.cpp
parentdfe7cb157938a861636c2a4dc1e53dbabba03fec (diff)
downloadzcatch-2b53f91a1f24dfba2837b458177042efd48260cd.tar.gz
zcatch-2b53f91a1f24dfba2837b458177042efd48260cd.zip
added the special binds again. console can now be accessed in the menus aswell
Diffstat (limited to 'src/game/client/components/binds.cpp')
-rw-r--r--src/game/client/components/binds.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp
index 05165e5e..18b0ae1e 100644
--- a/src/game/client/components/binds.cpp
+++ b/src/game/client/components/binds.cpp
@@ -1,9 +1,25 @@
 #include <engine/e_client_interface.h>
 #include "binds.hpp"
 
+bool BINDS::BINDS_SPECIAL::on_input(INPUT_EVENT e)
+{
+	// don't handle invalid events and keys that arn't set to anything
+	if(e.key >= KEY_F1 && e.key <= KEY_F25 && binds->keybindings[e.key][0] != 0)
+	{
+		int stroke = 0;
+		if(e.flags&INPFLAG_PRESS)
+			stroke = 1;
+		console_execute_line_stroked(stroke, binds->keybindings[e.key]);
+		return true;
+	}
+	
+	return false;
+}
+
 BINDS::BINDS()
 {
 	mem_zero(keybindings, sizeof(keybindings));
+	special_binds.binds = this;
 }
 
 void BINDS::bind(int keyid, const char *str)