about summary refs log tree commit diff
path: root/src/game/client/components/menus_settings.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-10-20 23:10:00 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-10-20 23:10:00 +0000
commitda473cf614cb49ddf15f7dde9cbaeb46aa86babf (patch)
tree80c7612a34f9c8b82b934aaa9ffaa461c0c30d55 /src/game/client/components/menus_settings.cpp
parentac1aeab149f704ab1b297be9c7662c5705e5e40d (diff)
downloadzcatch-da473cf614cb49ddf15f7dde9cbaeb46aa86babf.tar.gz
zcatch-da473cf614cb49ddf15f7dde9cbaeb46aa86babf.zip
fixed various issues with binding keys like enter and f1-f15
Diffstat (limited to 'src/game/client/components/menus_settings.cpp')
-rw-r--r--src/game/client/components/menus_settings.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp
index 3db02aa4..2e7a6912 100644
--- a/src/game/client/components/menus_settings.cpp
+++ b/src/game/client/components/menus_settings.cpp
@@ -18,6 +18,30 @@
 #include "menus.hpp"
 #include "skins.hpp"
 
+MENUS_KEYBINDER MENUS::binder;
+
+MENUS_KEYBINDER::MENUS_KEYBINDER()
+{
+	take_key = false;
+	got_key = false;
+}
+
+bool MENUS_KEYBINDER::on_input(INPUT_EVENT e)
+{
+	if(take_key)
+	{
+		if(e.flags&INPFLAG_PRESS && e.key != KEY_ESC)
+		{
+			key = e;
+			got_key = true;
+			take_key = false;
+		}
+		return true;
+	}
+	
+	return false;
+}
+
 void MENUS::render_settings_player(RECT main_view)
 {
 	RECT button;