Blueprint to C++ code

Instead of using

if (currentPlayerController->WasInputKeyJustPressed(EKeys::E))
{
      DoSomethingWhenPressed();
}

I think you should use something like:

InputComponent->BindAction("<yourinputname>", IE_Pressed, this, &<yourobject>::<themethodyouwanttobecalled>);

in the class of your pawn, in the method void ATPSProjectCharacter::SetupPlayerInputComponent(class UInputComponent* InputComponent)