Focus in UMG Widgets

Hi!

So I got my HUD up and working for keyboard and mouse, but I want to set it up so it is also navigable when you are using a gamepad. My HUD has 3 submenus, and I am using the D-pad buttons to open and close them (for example, D-pad Left opens the Inventory if it is not open, and closes it if it is open). In order to be able to navigate these menus using a gamepad, I am focusing specific buttons (for example, on opening the Inventory, I focus the first item’s button if there is at least one item, and the button which closes the Inventory if it is empty). However, I am having several issues:

  • As soon as any button is focused, the default “navigation system” that UMG uses overrides my action bindings involving the D-pad, so I am no longer able to use it to open and close menus. Instead, pressing any D-pad button just shifts the focus to another widget. Same happens with the left stick. This is regardless of Input Mode (Game Only or Game and UI).
  • Some widgets, such as borders or multi-line text boxes, that I don’t want to be focusable (but don’t have an “IsFocusable” option to turn off like buttons do), are able to gain focus. As soon as one of these “unwanted” widgets gains focus, the D-pad stops managing the widgets’ focus and again I am able to use it to open and close menus.
  • The mouse cursor always shows when I open the HUD, regardless of the default options set in my Player Controller or whether I tell the Player Controller to show or not show mouse cursor via blueprints (I want it to show if I open the menus via keyboard, and to not show if I open them via gamepad).

I wouldn’t mind setting up a custom “navigation system” in which I tell the HUD which button to focus everytime, covering every possibility, but I can’t do this if my action bindings are overridden by UMG’s default system.

Does anyone got any idea on how could I proceed? Is this just pending some UMG updating by Epic, or am I doing something wrong? :(.

Thanks in advance!

Hi!

I have the same problem. For a workaround use axis mappings plus some logic instead of action mappings. I will post a bug report. :wink:

Thank you Timbo! I will try this workaround of yours :). Here’s hoping for that 4.7 version.

I wasn’t able to get the axis mappings workaround to work, the mouse pointer appears still and doesn’t accept any more left or right d-pad input. The rest of the input still works though. Did you get it to work for you? Could you go into more detail?