Inputs and character movement

I’m trying to better understand the how inputs work in UE4, but I’m still a bit lost.

Peeking through the C++ code for the ShooterGame sample, I see the following in ShooterPlayerController.cpp:

void AShooterPlayerController::SetupInputComponent()
{
	Super::SetupInputComponent();

	// UI input
	BIND_ACTION(InputComponent, "InGameMenu", IE_Pressed, &AShooterPlayerController::OnToggleInGameMenu);
	BIND_ACTION(InputComponent, "Scoreboard", IE_Pressed, &AShooterPlayerController::OnShowScoreboard);
	BIND_ACTION(InputComponent, "Scoreboard", IE_Released, &AShooterPlayerController::OnHideScoreboard);

	// voice chat
	BIND_ACTION(InputComponent, "PushToTalk", IE_Pressed, &APlayerController::StartTalking);
	BIND_ACTION(InputComponent, "PushToTalk", IE_Released, &APlayerController::StopTalking);
}

BIND_ACTION I get, along with InputComponent, but the string that follows is what confuses me.

Where is this function created?

Also, what is IE_Pressed and IE_Released? For whatever reason, I can’t navigate to this code. (It’s obviously a .cpp, part of hidden source). I know that it means to check as though a key were pressed or released, but what is the “E”? Enumeration?

Finally, I see where &AShooterPlayerController::OnToggleInGameMenu is defined in ShooterControllerPlayer, so I get that it is being called each time the button tied to “InGameMenu” is pressed.

But where is "InGameMenu" being tied?

Are there any docs for inputs?

I see now! It’s in the DefaultInput.ini file!

All of the mappings are done there. For whatever reason I can’t read or write to the one in the shooter sample.

ie - the one for the flying game:

[/Script/Engine.PlayerInput]

!AxisMappings=EMPTY

+ActionMappings=(ActionName="Thrust", Key=SpaceBar)

+AxisMappings=(AxisName="MoveUp", Key=W, Scale=1.f)
+AxisMappings=(AxisName="MoveUp", Key=S, Scale=-1.f)

+AxisMappings=(AxisName="MoveRight", Key=D, Scale=1.f)
+AxisMappings=(AxisName="MoveRight", Key=A, Scale=-1.f)

Well I’ve answered my own question. I was looking for inputs in gameplay programming, but I found it elsewhere.

Here is a link to the page.

Essentially, all inputs can be created within the rocket editor, and there is a simple pull down menu to bind keyboard, mouse, and gamepad mappings to your actions.

Thanks for adding the link so others can find it :wink: