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.

I know this is extremely late but after running into the same issue I found myself here. With no solution in sight I started testing things on my own. With that being said, I have come to the conclusion that you can use bind actions to receive touch inputs.

To do so, make an action and make sure that the action data type is set to bool. Now, add 3 triggers to the action. Set these three triggers to released, pressed, and tap. Also, Incase you are using the MOBILEDEFAULTLEFTJOYSTICK (like I am) You can set the action to multiple touch bindings(in the input mapping context). This way, when the user is using the joystick they can also perform other tasks (such as jump). I am still just messing around with the enhanced input system but this is what I have found from testing multiple things. Hope it helps anyone who has ran into the same issues as me. :]

On the C++ end

EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &AMainCharacter::Jump);
EnhancedInputComponent->BindAction(JumpAction,ETriggerEvent::Completed,this, &AMainCharacter::StopJumping);