Download

Custom touch messages aren't firing

I’m writing a custom input module plugin and I’m unable to get Blueprints to recognize events like OnTouchStarted, OnTouchMove, and OnTouchEnded. The module is creating an InputDevice and registering it with the application. I’m then polling my device and attempting to send messages through the GenericApplicationMessageHandler in the SendControllerEvents function of the InputDevice.




UGameViewportClient* ViewportClient = GEngine->GameViewport;

if (ViewportClient != NULL)
{
	SWindow* Win = ViewportClient->GetWindow().Get();
	if (Win != NULL)
	{
		if (MessageHandler->OnTouchStarted(Win->GetNativeWindow(), FVector2D(500, 500), 1, 0))
		{
			UE_LOG(LogTemp, Warning, TEXT("OnTouchStarted"));
		}
		MessageHandler->OnMouseUp(EMouseButtons::Middle);
	}
}


I’m seeing the “OnTouchStarted” message in the test code above but no touch related events are firing in Blueprints. Oddly all keyboard and mouse events like the middle mouse one present in the snippet do fire in Blueprints.