UMG: When a Widget has focus, Action Mappings aren't handled on the Player Controller

There is a problem with UMG where if you focus a Widget, the Player Control will no longer handle action mappings. For example, I have a Player Controller in my game that handles a custom action mapping that I have defined, PauseButtonPressed. Upon pressing the button the first time, I show the menu and set focus to it. However, if I press the pause button again, it won’t un-pause. From what I can tell, the Player Controller doesn’t handle input events at all when a widget is focused.

Is there some way around this, or is this just a bug? It seems like it would be nice to have this as an option on the Player Controller, or maybe on specific action mappings that you wan’t handled all the time. Thanks in advance!

1 Like

I’m having the same problem. The focus issue is fixed so I don’t have to click once to focus my inventory widget, but then the action mappings no longer work so I can no longer close my inventory again. I have been debugging this the last couple of days and am no closer to finding out the problem, which leads me to believe this may be a problem with the 4.6 engine update.

Sorry, I misposted a second ago:

What I actually ended up having to do was handle the specific button press to “unpause” on the UMG widget itself, since you can’t handle the action mapping there or on the player controller at that point. This is a temporary solution, especially if the action mappings are going to be user customizable, but it works for now.

Ok, I was going to say that I am already handling it in the player controller. So you added a key binding in the widget itself? Do you have a screen by chance? I haven’t done key bindings in UMG yet. I’ve handled the UI action mappings in the player controller up to now.

I need to do some more testing but I think I actually just got mine working. Rather than using UI only as the input mode, I swapped it to the Game and UI and then unchecked the mouse and cursor options, which seems to keep it from rotating the camera when not hovering over the inventory. I will post later today after I run more tests to verify this.

Oh okay great! Let me know if you need any more help.

Would you mind posting your BP with the key binding? I am now having the problem where my weapon fires if I don’t click on an interactable UI object, so this is not a full fix for me and I need to do some other key bindings in UMG later anyway. Thanks for the help! I will still post back when I get it fixed.

Easier temporary fix that adds no overhead and should be easy to remove if/when this issue is fixed in the engine: Add a button that covers the entire canvas, set Alpha to 0 in all states, put at very low z order to act as a catch-all so control is never passed to player controller. I have used a similar principal with panels in WinForms and it seems to work just as well here.

Also want to know how to fix this ! I can’t put action mappings on the Event Graph of the UMG Widget so right now the only way to close the menu is to force it to a specific key event or having a Close button. It’s a temporary fix, but it’s not acceptable for a released game.

Same! I’m still using the same temporary fix. We need to get some Nick/Rudy up in here :slight_smile:

Been struggling with this for a few hours (maybe days, things get blurry for me) and after reading a lot of posts, tutorials, the basics… I didn’t find anything. I’m on 4.10 and this “issue” still exists there, really glad to come across your advice about setting input mode to Game and UI. Fixed my issue! Thanks a ton!!

1 Like

If you are pausing the game at the same time, then input is being frozen because the Player Controller is not receiving events. The simple way of handling this IMO (keeping on/off stuff in the same class) can be done by selecting your Action Mapped event for unpause in the Player Controller and Select “Execute when Paused” in the properties.

For reference: http://i.imgur.com/uGTbwly.png

Thanks. I’ll take that over firing a constant event tick.

Thank you for posting this, big help! I’d not noticed this tick box.

Mapping not working when pausing the game is a different issue, and yes, as you pointed out, very easy to solve. The problem is mapping not working when in Menus.