fixed esc key that I broke recently

This commit is contained in:
Magnus Auvinen 2008-10-21 18:25:28 +00:00
parent daf9a100eb
commit bf09116059

View file

@ -930,23 +930,22 @@ bool MENUS::on_input(INPUT_EVENT e)
{ {
last_input = time_get(); 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()) if(is_active())
{ {
// special handle esc and enter for popup purposes // special for popups
if(e.flags&INPFLAG_PRESS) if(e.flags&INPFLAG_PRESS || e.key == KEY_ENTER)
{ enter_pressed = true;
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;
}
}
if(num_inputevents < MAX_INPUTEVENTS) if(num_inputevents < MAX_INPUTEVENTS)
inputevents[num_inputevents++] = e; inputevents[num_inputevents++] = e;