diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-20 23:10:00 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-20 23:10:00 +0000 |
| commit | da473cf614cb49ddf15f7dde9cbaeb46aa86babf (patch) | |
| tree | 80c7612a34f9c8b82b934aaa9ffaa461c0c30d55 /src/game/client/components/menus.cpp | |
| parent | ac1aeab149f704ab1b297be9c7662c5705e5e40d (diff) | |
| download | zcatch-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.cpp')
| -rw-r--r-- | src/game/client/components/menus.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 86b794ef..a3ee6762 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -444,23 +444,22 @@ int MENUS::ui_do_key_reader(void *id, const RECT *rect, int key) if(ui_active_item() == id) { - for(int i = 0; i < num_inputevents; i++) + if(binder.got_key) { - INPUT_EVENT e = inputevents[i]; - if(e.flags&INPFLAG_PRESS && e.key && e.key != KEY_ESC) - { - new_key = e.key; - ui_set_active_item(0); - mouse_released = false; - num_inputevents = 0; - break; - } + new_key = binder.key.key; + binder.got_key = false; + ui_set_active_item(0); + mouse_released = false; } } else if(ui_hot_item() == id) { if(ui_mouse_button(0) && mouse_released) + { + binder.take_key = true; + binder.got_key = false; ui_set_active_item(id); + } } if(inside) |