Add CONTROL_ClearAllButtons

git-svn-id: https://svn.eduke32.com/eduke32@7898 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-08-07 20:06:27 +00:00 committed by Christoph Oelckers
parent 640b1c4461
commit 7d96aba66d
3 changed files with 11 additions and 0 deletions

View file

@ -50,6 +50,7 @@ void I_ClearAllInput(void)
KB_ClearKeysDown();
MOUSE_ClearAllButtons();
JOYSTICK_ClearAllButtons();
CONTROL_ClearAllButtons();
}

View file

@ -155,6 +155,7 @@ void CONTROL_ClearAssignments( void );
// void CONTROL_GetFunctionInput( void );
void CONTROL_GetInput( ControlInfo *info );
void CONTROL_ClearButton( int whichbutton );
void CONTROL_ClearAllButtons( void );
extern float CONTROL_MouseSensitivity;
bool CONTROL_Startup(controltype which, int32_t ( *TimeFunction )( void ), int32_t ticspersecond);
void CONTROL_Shutdown( void );

View file

@ -735,6 +735,15 @@ void CONTROL_ClearButton(int whichbutton)
CONTROL_Flags[whichbutton].cleared = TRUE;
}
void CONTROL_ClearAllButtons(void)
{
CONTROL_ButtonHeldState = 0;
CONTROL_ButtonState = 0;
for (auto & c : CONTROL_Flags)
c.cleared = TRUE;
}
void CONTROL_ProcessBinds(void)
{
if (!CONTROL_BindsEnabled)