If I map an input action in an IMC with “Touch 1” and the Hold trigger it stops sending Canceled event after the first Completed. If the Hold trigger is marked as “Is One Shot” it stops working after the first Completed. Tested with a blank project. Is it supposed to be like this?
Hello [mention removed]!
Thank you for reporting this issue with the Input Touch. We were able to reproduce it in UE5.X versions, including the latest source version.
We believe it must be an engine bug since Hold trigger with Mouse click keeps firing Canceled events as expected which should be consistent with Input Touch as well.
We are filing an internal report about this and you should be able to track the progress once Epic makes it public: https://issues.unrealengine.com/issue/UE-353657.
(As a note, we found that currently, the Input Touch Hold trigger will only reset after you press on a UI element.)
In the meantime, as a workaround, consider creating a child class of EnhancedPlayerInput and overriding the EvaluateKeyMapState function to reset the Input Touch action value upon pressing down, allowing repeated Hold triggers.
(Set your custom class in ProjectSettings->Input->Default Classes->Default Player Input.)
void UMyEnhancedPlayerInput::EvaluateKeyMapState( const float DeltaTime, const bool bGamePaused, TArray<TPair<FKey, FKeyState*>>& KeysWithEvents)
{
for (TPair<FKey, FKeyState>& KeyPair : GetKeyStateMap())
{
FKeyState& KeyState = KeyPair.Value;
if (KeyPair.Key.IsTouch() && !KeyState.bDown)
{
// Clear its RawValue so triggers can reset
KeyState.RawValue = FVector::ZeroVector;
}
}
Super::EvaluateKeyMapState(DeltaTime, bGamePaused, KeysWithEvents);
}
Please let me know if it helps you achieve expected results and don’t hesitate to ask if you need any further assistance.
Best regards,
Joan