diff --git a/source/duke3d/src/input.cpp b/source/duke3d/src/input.cpp index 940a3e312..3d1bbd614 100644 --- a/source/duke3d/src/input.cpp +++ b/source/duke3d/src/input.cpp @@ -50,6 +50,7 @@ void I_ClearAllInput(void) KB_ClearKeysDown(); MOUSE_ClearAllButtons(); JOYSTICK_ClearAllButtons(); + CONTROL_ClearAllButtons(); } diff --git a/source/mact/include/control.h b/source/mact/include/control.h index ca85d0730..76ad4ec2f 100644 --- a/source/mact/include/control.h +++ b/source/mact/include/control.h @@ -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 ); diff --git a/source/mact/src/control.cpp b/source/mact/src/control.cpp index 6a5665e54..0712a1b3e 100644 --- a/source/mact/src/control.cpp +++ b/source/mact/src/control.cpp @@ -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)