Using Touch with the Enhanced Input Component?

I’m wondering if anyone can give me a little help setting up the enhanced input component in c++ for touch input.

This BindTouch() function does not seem to work:

PlayerEnhancedInputComponent->BindTouch(IE_Pressed, this, &APN_FreighterPrimary::TouchStarted);

It goes through to the BindTouch() inside of EnhancedMovementComponent.h but all those functions have a deleted c++ tag on them as seen below which means they can’t be used.

FInputTouchBinding& BindTouch(const EInputEvent KeyEvent, UserClass* Object, typename FInputTouchHandlerSignature::TMethodPtr< UserClass > Func) = delete;

How am I supposed to bind my touch events using the Enhanced Movement component if the Binding Helpers for touch are unavailable. I get this error message when I try to build.

function “UEnhancedInputComponent::BindTouch(EInputEvent KeyEvent, UserClass *Object, TDelegate<void (ETouchIndex::Type, FVector), FDefaultDelegateUserPolicy>::TMethodPtr Func) [with UserClass=APN_FreighterPrimary]” (declared at line 456 of “C:\PROGRAM FILES\EPIC GAMES\UE_5.0\ENGINE\PLUGINS\EXPERIMENTAL\ENHANCEDINPUT\SOURCE\ENHANCEDINPUT\PUBLIC\EnhancedInputComponent.h”) cannot be referenced – it is a deleted function

Appreciate any help!

You need to use the BindAction with the enhanced Input system.

TObjectPtr<UInputAction> MyInputAction;

/* Note : You can use different trigger events. You can use an ongoing one for getting inputs each ticks, which can be nice for locomotion inputs */
BindAction(MyInputAction, ETriggerEvent::Triggered, this, AMyClass::MyBoundFunction())

AMyClass::MyBoundFunction() can have any of the three definitions you see in the EnhancedInputComponent.h :


The first one is the one without any params, the second one takes a const FInputActionValue& that you can interpret as a bool, axis1D/2D/3D. I never used the third one.