One area I’ve found to be particularly cumbersome is handling gamepad input & widget focus in UMG menus. I’ll do my best to annotate specific issues & how I think they could be fixed. First, here’s a quick video demoing my front end menu system:
https://drive.google.com/open?id=0B9Wy3lqTOMHKWG1uSHhsRm1INkk
If the issues below can be resolved, it’d remove SO much complex blueprint bookkeeping that’s currently required.
1. Communicating Widget Focus to the User
Problem:
There is no simple way to clearly communicate which widget currently has gamepad (or keyboard) focus.
Suggestion for Fix:
Add a new “Focused” style for all relevant widgets (button, checkbox, combo box, slider, etc.) and focus sound events. I view keyboard focus & mouse hover as kinda the same thing. IMHO, there should be an analog “focus” implementation for every “hover” implementation.
2. Handling Widget Focus Events & Tracking Widget Focus
Problem:
There is no simple way to track which widget currently has focus or when a widget changes focus.
Suggestion for Fix:
There are blueprint callbacks for user defined widgets like OnFocusReceived & OnFocusLost, but there are no events for core widgets like Buttons. Again, in the spirit of matching “hover” implementations, adding new “On Focused” & “On Unfocused” bindings here could help. In addition, it would be really useful to be able to query which widget currently has focus at any given time. In all my time searching, I haven’t been able to find a blueprint function (or function in code, for that matter) that can do that.
3. Losing Widget Focus w/ Unhandled Mouse Clicks
Problem:
When you mouse click an area of the screen that has no effect for a menu, you lose current keyboard focus. I’ve included some examples of other users running into this problem. Moderators say it’s “working as intended”, but it’s SUPER confusing/annoying in practice.
- [bug] losing focus when clicking in level view - UI - Unreal Engine Forums
- UMG Mouse Vanishes After Clicking Background - Programming & Scripting - Unreal Engine Forums
- Clicking changes focus from widget to viewport - UI - Unreal Engine Forums
- https://forums.unrealengine.com/showthread.php?64930-Mouse-click-breaks-all-input
The answer on this post is actually what I’m doing to handle this issue and it’s a giant pain for complex menus:
Suggestion for Fix:
Add an option to keep current widget focus if user has unhandled mouse click event…or something. This one I’m less sure about how to handle, but the current workarounds are not great.
4. Focus Brush Is Difficult to Work With
Problem:
It took me FOREVER just to figure out how to turn it off and there’s no way to change its look.
Suggestion for Fix:
I don’t really see how this would be needed if all of the above are taken care of.