From bf09116059d7a712b42a0a352df54a4057b40fa6 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Tue, 21 Oct 2008 18:25:28 +0000 Subject: [PATCH] fixed esc key that I broke recently --- src/game/client/components/menus.cpp | 29 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 2fe150e44..e43512605 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -930,23 +930,22 @@ bool MENUS::on_input(INPUT_EVENT e) { last_input = time_get(); + // special handle esc and enter for popup purposes + if(e.flags&INPFLAG_PRESS) + { + if(e.key == KEY_ESC) + { + escape_pressed = true; + set_active(!is_active()); + return true; + } + } + if(is_active()) { - // special handle esc and enter for popup purposes - if(e.flags&INPFLAG_PRESS) - { - if(e.key == KEY_ESC) - { - escape_pressed = true; - set_active(!is_active()); - return true; - } - else if(e.key == KEY_ENTER) - { - enter_pressed = true; - return true; - } - } + // special for popups + if(e.flags&INPFLAG_PRESS || e.key == KEY_ENTER) + enter_pressed = true; if(num_inputevents < MAX_INPUTEVENTS) inputevents[num_inputevents++] = e;