diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-04-05 12:19:17 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-04-05 12:19:17 +0000 |
| commit | e3fcdcf378afd1a9be2ebfe597c4b4de42fd8566 (patch) | |
| tree | b6bd4e4944a85ee92e17b6113bd34ede710058d2 /src | |
| parent | fabdd7b2dce4b99737cfb868d258cf49abcff893 (diff) | |
| download | zcatch-e3fcdcf378afd1a9be2ebfe597c4b4de42fd8566.tar.gz zcatch-e3fcdcf378afd1a9be2ebfe597c4b4de42fd8566.zip | |
fixed console bind problem
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/client/gc_console.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/game/client/gc_console.cpp b/src/game/client/gc_console.cpp index 90fc8afc..935aac91 100644 --- a/src/game/client/gc_console.cpp +++ b/src/game/client/gc_console.cpp @@ -456,12 +456,25 @@ bool console_input_cli(INPUT_EVENT e, void *user_data) return true; } +static bool console_execute_event(INPUT_EVENT e) +{ + // don't handle invalid events and keys that arn't set to anything + if(e.key <= 0 || e.key >= KEY_LAST || keybindings[e.key][0] == 0) + return false; + + int stroke = 0; + if(e.flags&INPFLAG_PRESS) + stroke = 1; + console_execute_line_stroked(stroke, keybindings[e.key]); + return true; +} + bool console_input_special_binds(INPUT_EVENT e, void *user_data) { // only handle function keys if(e.key < KEY_F1 || e.key > KEY_F25) return false; - return console_input_normal_binds(e, user_data); + return console_execute_event(e); } bool console_input_normal_binds(INPUT_EVENT e, void *user_data) @@ -469,16 +482,7 @@ bool console_input_normal_binds(INPUT_EVENT e, void *user_data) // need to be ingame for these binds if(client_state() != CLIENTSTATE_ONLINE) return false; - - // don't handle invalid events and keys that arn't set to anything - if(e.key <= 0 || e.key >= KEY_LAST || keybindings[e.key][0] == 0) - return false; - - int stroke = 0; - if(e.flags&INPFLAG_PRESS) - stroke = 1; - console_execute_line_stroked(stroke, keybindings[e.key]); - return true; + return console_execute_event(e); } void console_toggle(int type) |