Merge branch 'add-unblockable-console-key' into 'next'

Add unblockable console key

See merge request STJr/SRB2!2531
This commit is contained in:
Hanicef 2025-03-20 09:40:32 +00:00
commit 81465eae39
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