Reset current input when losing focus of game viewport

This commit is contained in:
Kevin Poretti 2023-11-10 14:27:55 -05:00
parent c09094e186
commit c3a0d1f481
2 changed files with 13 additions and 0 deletions

View File

@ -56,6 +56,7 @@ void AFFPlayerController::AddCurrentInputToBuffer()
//SendInputsToRemote();
}
bool AFFPlayerController::CheckInputSequence(const FFFInputSequence& InInputSequence)
{
return InputBuffer->CheckInputSequence(InInputSequence);
@ -80,6 +81,7 @@ bool AFFPlayerController::CheckInputSequences(const TArray<FFFInputSequence>& In
return false;
}
void AFFPlayerController::DisableMostRecentInput()
{
InputBuffer->DisableMostRecentInput();
@ -101,3 +103,12 @@ void AFFPlayerController::SetupInputComponent()
}
}
}
void AFFPlayerController::FlushPressedKeys()
{
Super::FlushPressedKeys();
RawInput.Buttons = 0;
RawInput.MoveAxes = FVector2D::ZeroVector;
}

View File

@ -75,6 +75,8 @@ public:
// APlayerController interface
virtual void SetupInputComponent() override;
virtual void FlushPressedKeys() override;
// End of APlayerController interface
protected: