From 2b53f91a1f24dfba2837b458177042efd48260cd Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 30 Aug 2008 09:34:55 +0000 Subject: added the special binds again. console can now be accessed in the menus aswell --- src/game/client/components/binds.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/game/client/components/binds.cpp') 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 #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) -- cgit 1.4.1