Add unblockable console key

This commit is contained in:
Gustaf Alhäll 2024-10-20 12:35:56 +02:00
parent 987d2ee59a
commit da50e4cd7f
3 changed files with 20 additions and 0 deletions

View file

@ -918,6 +918,22 @@ static void CON_InputDelChar(void)
// ----
//
//
// Same as CON_Responder, but is process before everything else, so it cannot be blocked.
//
boolean CON_PreResponder(event_t *ev)
{
if (ev->type == ev_keydown && shiftdown == 1 && ev->key == KEY_ESCAPE)
{
I_SetTextInputMode(con_destlines == 0); // inverse, since this is changed next tic.
consoletoggle = true;
return true;
}
return false;
}
//
// Handles console key input
//
boolean CON_Responder(event_t *ev)

View file

@ -19,6 +19,7 @@ void CON_Init(void);
void CON_StartRefresh(void);
void CON_StopRefresh(void);
boolean CON_PreResponder(event_t *ev);
boolean CON_Responder(event_t *ev);
#ifdef HAVE_THREADS

View file

@ -227,6 +227,9 @@ void D_ProcessEvents(void)
}
}
if (CON_PreResponder(ev))
continue;
// Screenshots over everything so that they can be taken anywhere.
if (M_ScreenshotResponder(ev))
continue; // ate the event