Hey all,
I am trying to set up some buttons (normal Common Buttons and Bound Action Buttons) to support hold inputs.
If I just put a Common Button in any of my menus and enable Requires Hold, clicking and holding on it does indeed make the progress bar go up. This never works though when the button has an Enhanced Input Action assigned to it and I am trying to trigger it with its assigned input, only through clicking.
Looking at the source code, I feel like the automatic handling of hold inputs is only supported with the legacy input system:
void UCommonButtonBase::BindTriggeringInputActionToClick()
{
if (CommonUI::IsEnhancedInputSupportEnabled() && TriggeringEnhancedInputAction)
{
FBindUIActionArgs BindArgs(TriggeringEnhancedInputAction, false, FSimpleDelegate::CreateUObject(this, &UCommonButtonBase::HandleTriggeringActionCommited));
BindArgs.OnHoldActionProgressed.BindUObject(this, &UCommonButtonBase::NativeOnActionProgress);
BindArgs.bIsPersistent = bIsPersistentBinding;
BindArgs.InputMode = InputModeOverride;
TriggeringBindingHandle = RegisterUIActionBinding(BindArgs);
return;
}
if (TriggeringInputAction.IsNull() || !TriggeredInputAction.IsNull())
{
return;
}
if (!TriggeringBindingHandle.IsValid())
{
FBindUIActionArgs BindArgs(TriggeringInputAction, false, FSimpleDelegate::CreateUObject(this, &UCommonButtonBase::HandleTriggeringActionCommited));
BindArgs.OnHoldActionProgressed.BindUObject(this, &UCommonButtonBase::NativeOnActionProgress);
BindArgs.OnHoldActionPressed.BindUObject(this, &UCommonButtonBase::NativeOnPressed);
BindArgs.OnHoldActionReleased.BindUObject(this, &UCommonButtonBase::NativeOnReleased);
BindArgs.bIsPersistent = bIsPersistentBinding;
BindArgs.bForceHold = GetConvertInputActionToHold();
BindArgs.InputMode = InputModeOverride;
TriggeringBindingHandle = RegisterUIActionBinding(BindArgs);
}
}
Has anyone ever managed to figure this out?