How to use Enhanced input with Common UI in UE5.3?

Hi, I was working on my game with Enhanced Input and was trying to find a way to divide input for UI and gameplay. I found out that Common UI was a great tool to do that.
I followed a few Tutorials on Common UI and the official Enhanced Input linkup for Common UI. After all that jazz, I created my test UI and added a CommonActivatableWidget with my new Input Mapping.
Now, I don’t have any Input working when the UI open up.

Looked everywhere and found nothing on the interaction between these plugins except for the single one on how to connect both.

So to reiterate, I’m asking for more info on the interaction of Enhanced Input with Common UI. How to make them work together ?

1 Like

Hey there bob.

Few things to check first. Now I am not an expert but just got my enhanced input with CommonUI working last night, so I am more going to explain how mine is currently setup and you can pick and choose if you want to do the same. This is with Unreal engine 5.3.2:

  • Make a HUD widget, create this and add it to your viewport. Mine is a Common User widget. The HUD widget should have a Activatable stack with the ability to Push to it (mine is a custom event at the moment that takes in a Widget class reference input).

  • Follow this guide: Using CommonUI With Enhnaced Input in Unreal Engine | Unreal Engine 5.2 Documentation (sounds like you have, but just in case).

  • Create an activatable widget, if you want it to handle deactivating the widget tick: “Is Back Handler” so it is true.

  • In the activatable widget, in the Input section put the IMC you made in the above docco in the “Input Mapping” field.

  • Ensure “Is focussable” in your activatable widget is true.

  • Push the above activatable widget to your HUDs widget stack however you want to bring the widget up.

  • If you want to navigate some buttons using the keyboard or a gamepad using the Dpad/Arrow keys: In the Activatable widget, override GetDesiredFocusTarget and set your button to the return value.

  • To get Enhanced Input Action events to fire, it seems that you need to also Override the function: GetDesiredInputConfig and set the Input Mode to “All”. I have no idea why this needs to be all, after going through some of the C++ it seems that there are some conditionals in the ProcessNormalInput functions that seem to want it? But yeah, this seems to be required to allow your non-generic input action events to fire:

  • Note: As you can see here you can turn off your move and look input, so they don’t still fire. But be aware that other game inputs may still try to fire if they aren’t being handeled in your UIs IMC you would of made as apart of the Unreal docco link above. This feels a bit hacky, but I mean Common UI is still in beta after all.

By now you should be able to use your input. But you might notice that when you close all the activatable widgets on your stack you are stuck in UI mode, I have read that the reason for this is that the activatable widgets, when removed, restore the input mode to the next activatable widget on the stack. But if you back all the way out, the stack is empty.

This can be remedied (again a bit hacky but this is how I got it working last night) by:

  • In your HUD widget, on construct, Push an empty activatable widget (lets call it WBP_Test) to your stack. Do not change any of the default settings on this empty WBP_Test widget like we did above, we do not want it to do anything special (handle backs etc).

  • In this empty widget, WBP_Test, override the GetDesiredInputConfig like we did above, but instead set the MakeUiInputConfig match whatever you are running in your game. So if you are running a very vanilla game for example:

I hope that helps! Again I am no expert, so I would love to hear if anyone has any other ways of doing all of this. But I imagine that in the future versions of UE Epic will iron some of these things out.

Good luck with your project!

7 Likes

Thank you, so much. My Game work now. Only thing, I wonder if I can fix an IMC to the Input mode of Common UI. But I won’t meddle with it. I’m too scared to mess it up.

1 Like

That is great! Love to hear it!
I haven’t figured out a way to set an IMC to all your common ui windows either, but if I do I will pop back in here and post it.
I am sure in the future releases of UE Epic will smooth all these growing pains out but

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.