CommonUI - Can't get Hover/Click to work with gamepad

Prototyping a simple MainMenu, i can’t get CommonUI to recognize gamepad inputs.

void UMainMenu::NativeOnActivated()
{
Super::NativeOnActivated();
GetDesiredFocusTarget()->SetFocus();

}
UWidget* UMainMenu::NativeGetDesiredFocusTarget() const
{
if (PlayButton) return PlayButton;
return Super::NativeGetDesiredFocusTarget();
}

With the WidgetReflector i can see that it’s focused, i can press down on the Dpad to go to the next button, but none of them are hovered / accepting input except when using mouse.

*Default input type is set to Gamepad in CommonUI Input Settings

Interesting,

So as far as i understood you have navigation with gamepad already, you can navigate 3 buttons with gamepad.

However its not making a visual identification to you like hower right? It’s normal since focus is not hovered state and simply you can set howevered style or state or focus or OnFocus you can just set button state to selected that is also a valid approach. If there is a button down interact() problem can be around input handling in the button.

if (auto* MyButton= Cast<UCommonButtonBase>(this)) MyButton->SetIsSelected(true);

Let us know if I got your question right.

It is being focused, overriding HandleFocusReceived does log that the button is focused.
But when the default input type is set to Gamepad, it should act as a mouse hover with the CommonAnalogCursor

After a couple of hours i managed to get to the root of the problem:

image

This setting has no effect on my project, and it defaults to ECommonInputType::MouseAndKeyboard.

I noticed that after overriding FCommonAnalogCursor and UCommonUIActionRouterBase
and also setting Link Cursor To Gamepad Focus to true in Project Settings.

FCommonAnalogCursor::RefreshCursorVisibility() would Tick for ActiveInputMethod==ECommonInputType::Gamepad only after clicking once with the Gamepad, which brought me to this realization, after going through some hoops with setting the desired input type in GameInstance and feeding that into MainMenu Widget → custom overrides, it seems to work.

Still unsure what’s causing it.