How do you call the click event on a specific button in an array of buttons in UMG?

I’m building a pretty menu heavy game and need both controller & mouse/keyboard support.

To do this, I’m manually managing & tracking what button is active. Basically if every button is in a scroll box or vertical box, I’m keeping track of an INT for which has focus. When a key press event is detected (i.e.: Gamepad A or Enter) I’m calling an event in a blueprint interface on the in the slot corresponding to the INT. Each button has an interface event I’m calling “simulated button press”, which executes the same path as the actual button press.

On arrow/L-Stick up & down, I’m incrementing & decrementing the int, as long as it’s within the bounds of the child count of the parent box that holds all the buttons. On each change of that INT, I’m also updating the children of the box to set their various focused attributes (unhide an arrow, set the style of the button).

This setup is really extensible and reusable, since the only data that the player is changing is the currently focused INT, and the it can go is based on a child count of the parent.

Somewhat annoyingly, I also need to flag “can have focus” to OFF on everything, otherwise the existing shoddy tab-style focus system can get in the way, and eat your non-mouse click inputs.