コード例 #1
0
bool UDozerGameViewportClient::InputKey(FViewport* Viewport,
	int32 ControllerId,
	FKey Key,
	EInputEvent Event,
	float AmountDepressed,
	bool bGamepad){

	Super::InputKey(Viewport, ControllerId, Key, Event, AmountDepressed, bGamepad);

	if (ControllerId == 0){

		if (Key.GetDisplayName().ToString().Equals(TEXT("Up"))){
			Super::InputKey(Viewport, 1, FKey("W"), Event, AmountDepressed, bGamepad);
		}
		else if (Key.GetDisplayName().ToString().Equals(TEXT("Down"))){
			Super::InputKey(Viewport, 1, FKey("S"), Event, AmountDepressed, bGamepad);
		}
		else if (Key.GetDisplayName().ToString().Equals(TEXT("Left"))){
			Super::InputKey(Viewport, 1, FKey("A"), Event, AmountDepressed, bGamepad);
		}
		else if (Key.GetDisplayName().ToString().Equals(TEXT("Right"))){
			Super::InputKey(Viewport, 1, FKey("D"), Event, AmountDepressed, bGamepad);
		}
	}

	return true;
}
コード例 #2
0
FText UKismetInputLibrary::Key_GetDisplayName(const FKey& Key)
{
	return Key.GetDisplayName();
}