If I add many of these buttons into another widget, keyboard navigation and interaction work just fine, I can use the arrows to navigate between different buttons, and press the space bar for button press functionality.
Then I made another widget, which should work as a quest entry in a quest log. this quest entry widget has this custom button inside it:
But when I add some of those quest entries to my quest log widget, space bar won’t work for button press, unless I click the button with mouse left button first. arrow navigation still works, buttons will get focused, but even though a button has focus, space bar press doesn’t work before I click that button.
even though on the quest entry widget debug I was checking if the subwidget had focus, it returned true, and when I clicked the button, the button template itself got focused. when using arrows to navigate, focus went back to the quest entry widget below.
I tried setting keyboard focus to the button widget itself on quest entry added to focus path, but that was causing an infinite loop, even though the button itself wasn`t getting focused.
so I created a custom event to set keybaord focus to the specific button widget: