How to "Get Focused Widget"?

Trying to make a game that is intended to be played by people with a visual impairment. currently trying to set up the main menu and would like it to usable. This means clear feedback on which button is being focused on via audio feedback and clear visuals. I thought I would just be able to able to play an audio event based on which widget was in focus but I can’t figure out how to do it. The best solution I have got is a series of branches that check if the first widget has user focus and if not check the second, and then the third and so on. Surely there is a better way to do this.

Also the actual focus imagery is very hard to see, and don’t appear on the widget until the focus has been changed once. Is there a way to make it appear straight away and also make it more obvious, like the visual changes that you can do when hovered?

Would the OnHover events for the button widgets work?

It does not - the hover state is different from the focus state and won’t come into play if you’re building a controller- or keyboard-driven UI.

The best solution I’ve found for this so far is to set up your own state for the buttons and use the Has Keyboard Focus node to toggle to a new style. This video is a pretty good walkthrough of how to do so: UE4 - Easy Gamepad and Keyboard navigation in UMG menus - YouTube

You can also do something similar but with image widgets you toggle on and off to use as current selection indicators.

1 Like