UE5 Dev log #2

Gamepad support in Lyra's Confirmation Screen in UE5.4 with EnhancedInput

I had a situation where I needed to implement the CommonUI support in UE5.4 with EnhancedInput support enabled. After hours of debugging I found the reason:

	else if (bIsEnhancedInputSupportEnabled && !BindArgs.InputAction.IsValid())
	{
		UE_LOG(LogUIActionRouter, Error, TEXT("Cannot bind widget [%s] to action [%s] - provided input action is invalid."), *InBoundWidget.GetName(), *BindArgs.GetActionName().ToString());
		return FUIActionBindingHandle();
	}

When I tried to create an Action Binding it required EnhancedInputAction... but LyraConfirmationScreen didn't support it.

This condition was later fixed in UE5.5, but I did manage to fix it by adding the EhancedInputActions to Confirmation Screen's setup:

FDataTableRowHandle ActionRow;
UInputAction* InputAction;//added

switch(Action.Result)
		{
			case ECommonMessagingResult::Confirmed:
				ActionRow = ICommonInputModule::GetSettings().GetDefaultClickAction();
				InputAction = ICommonInputModule::GetSettings().GetEnhancedInputClickAction();//added
				break;
			case ECommonMessagingResult::Declined:
				ActionRow = ICommonInputModule::GetSettings().GetDefaultBackAction();
				InputAction = ICommonInputModule::GetSettings().GetEnhancedInputBackAction();//added
				bEnableTapToClose = true;
				break;
			case ECommonMessagingResult::Cancelled:
				ActionRow = CancelAction;
				InputAction = ICommonInputModule::GetSettings().GetEnhancedInputBackAction();//added
				break;
			default:
				ensure(false);
				continue;
		}

		UR2ButtonBase* Button = EntryBox_Buttons->CreateEntry<UR2ButtonBase>();
		Button->SetTriggeringInputAction(ActionRow);
		Button->SetTriggeringEnhancedInputAction(InputAction);//added
		Button->OnClicked().AddUObject(this, &ThisClass::CloseConfirmationWindow, Action.Result);
		Button->SetButtonText(Action.OptionalDisplayText);
		Buttons.Add(Button);

Read more