mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed esc key that I broke recently
This commit is contained in:
parent
daf9a100eb
commit
bf09116059
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue