How to get the currently focused widget in Unreal Engine

In Unreal Engine, you can determine the currently focused widget in both Slate and UMG UI systems. Slate To get the currently focused Slate widget, you can use the following code snippet: // Instead of 0, you can pass the user index if you have multiple users TSharedPtr<SWidget> FocusedSlateWidget = FSlateApplication::Get().GetUserFocusedWidget(0); UMG Getting the currently focused UMG widget is a bit more involved, since there is no direct function to get it or the place where it is stored....

March 23, 2024 · 1 min · Georgy Treshchev