Control UMG navigation with input mappings

Hi there!

I’m a bit new to unreal so this question might be my lack of proper understanding of UMG and widgets in general, but I can’t seem to find clear instructions on how to control navigation in widgets and menus using inputs mappings.

Say that I have a dialog or a menu, for example, and it has options. I want to give my players the ability to select and choose an option using the keyboard (no mouse) or the joystick, so my first idea was to use the input mappings defined in the project settings, but I can’t find a way to do it.

For the keyboard specifically, I noticed that I can navigate the options using the keyboard arrows, and press buttons with the “return” key, but what about other key mappings like WASD for navigation and other action buttons that I defined for my game?

Hello! In fact widgets and commonly UMG are processing input events in their own functions and you can use some configuration like one on attached screenshot just to define logic depending on Input Action / Input Axis (something similar can be done with Enhanced input thorugh adding Input Mapping Context prop and needed Input Actions props). However, you can do it in another way - catch all inputs in PlayerController and then redirect callbacks to widgets through corresponding props of of Widget subclasses on PlayerController or HUD. Both approaches are ok. If you want very sharp system, you can try something like this:

  • Create some state machine and control it state with Input Actions
  • Show some UI when enetering state of State Machine and hide when leaving