Input: Separate everything in AdvanceTrigger into a new TextSubmit except Space so it doesn't submit text fields such as savegames

git-svn-id: https://svn.eduke32.com/eduke32@8025 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-08-16 00:20:52 +00:00 committed by Christoph Oelckers
parent 757b19ad3f
commit 673bd16299

View file

@ -54,12 +54,11 @@ void I_ClearAllInput(void)
}
int32_t I_AdvanceTrigger(void)
int32_t I_TextSubmit(void)
{
return
KB_KeyPressed(sc_Enter)
|| KB_KeyPressed(sc_kpad_Enter)
|| KB_KeyPressed(sc_Space)
#if !defined EDUKE32_TOUCH_DEVICES
|| MOUSEINACTIVECONDITIONAL(MOUSE_GetButtons()&LEFT_MOUSE)
#endif
@ -70,10 +69,9 @@ int32_t I_AdvanceTrigger(void)
;
}
void I_AdvanceTriggerClear(void)
void I_TextSubmitClear(void)
{
KB_FlushKeyboardQueue();
KB_ClearKeyDown(sc_Space);
KB_ClearKeyDown(sc_kpad_Enter);
KB_ClearKeyDown(sc_Enter);
MOUSE_ClearButton(LEFT_MOUSE);
@ -83,6 +81,19 @@ void I_AdvanceTriggerClear(void)
#endif
}
int32_t I_AdvanceTrigger(void)
{
return
I_TextSubmit()
|| KB_KeyPressed(sc_Space);
}
void I_AdvanceTriggerClear(void)
{
I_TextSubmitClear();
KB_ClearKeyDown(sc_Space);
}
int32_t I_ReturnTrigger(void)
{
return
@ -377,9 +388,9 @@ int32_t I_EnterText(char *t, int32_t maxlength, int32_t flags)
}
}
if (I_AdvanceTrigger())
if (I_TextSubmit())
{
I_AdvanceTriggerClear();
I_TextSubmitClear();
return 1;
}
if (I_ReturnTrigger())