Debug to show where focus currently is?

Is there a way to tell where focus currently is (during runtime)? Like if it’s on a specific widget or somewhere else. Just for debug purposes. Thanks for any help.

Do you mean what the camera is pointing at? Then it would be a line trace…

You could override this - ideally in the parent class so you do not need to add it manually - and call a dispatcher:

image

And then:

edit: untick Top Level Only


Perhaps you could even skip the dispatcher bit and just receive a notification in onFocusReceived / Lost inside the widget. Not sure where you want that trigger - hence the suggestion to use a dispatcher.

2 Likes

thank you!

Given that he says “widget,” I think he means “which GUI widget has the current keyboard focus.”

2 Likes

Yes, I realise that now… Didn’t see the word widget on the first read…

Yes thats it. I had some widget grabbing focus but couldnt figure out who it was. I figured there may be faster way to know then filtering through individual parts of a widget one by one.

In actuality though, the problem was that when changing to Game and UI only input, I wasn’t setting which widget to focus to (just one of those dumb simple things, forgetting to connect a noodle). I dunno what it was actually doing, but the result was that my tab key (used to toggle the widget) would get focused on something and not allow it to toggle correctly.

1 Like

This is what you could also try, just in case: How to get the currently focused widget in Unreal Engine | Georgy's Tech Blog