[UE5] How do you give back keyboard input priority to player controller after closing widget?

Hello, how would you go about giving back the player controller input priority after clsoing the widget? I noticed that if the keybind for axis and action mapping are the same, there’s no conflict but the moment that let’s say [spacebar] is used for jump but also for a widget condition, there is conflict even after the widget is removed from parent.

Sure, I could do it all in the player controller blueprint but why? Surely there’s a way to do this.

Presently I have [Remove from Parent] → Collect garbage

I have attempted many different routes such as playing with input priority and input modes but have yet to get it to work. Any help on this would be greatly appreciated!

Use [Set Input Mode Game Only] node.

I’m sorry but that doesn’t help the situation. The inputs are fine after leaving the widget as long as the action mapping isn’t the same between character blueprint and the widget.

Let’s pretend:
Action Mapping [Spacebar] (Jump)
Character blueprint: Player jumps

Action Mapping [Spacebar] [Confirm Widget UI Action]
Widget blueprint: Confirms Widget Action

Upon the creation of the widget, spacebar will be taken over by the widget even after it is destroyed and removed by garbage collection (allegedly). There doesn’t seem to be a unbind / bind method for action mapping on character or widget blueprints.

Kind of an odd behavior I think but there must be something I don’t know as a prerequisite, maybe an option in character blueprint that i’m missing.

How do you setup input in widget? Do you use ListenForInputAction with Consume box checked?


Thanks for letting me know about ListenForInputAction! Understanding how keyboard inputs work in Unreal made it a lot easier to implement. I followed along the instructions in this video which explained everything well.

1 Like