User Interface Widget and "Set Mode UI Only" do not capture input

Hi!

I created a simple Widget to show the problems that I’m facing. The issue is that once I use “Set Input Mode UI Only,” I’m no longer able to capture keyboard input. I want to prevent the character from moving when the widget is open. Any idea what I might be missing? Thanks!

Many ways to accomplish it, choose one:

  • set the Input mode to UI only
  • remove context mapping
  • disable movement for the character
  • disable input in the character
  • consume input in widget
  • probably a bunch more

Each method will have a slightly different effect but all would prevent player movement. Context Mapping is the modern and versatile option.

1 Like

Hi Everynone!

Thanks for the reply. As I showed in the screenshot, I’m using the “Set Mode UI Only”, however it doesn’t work, is not capturing the keys.

I’m gonna try to use some of your suggestions as a workaround, but somehow seems a bit “hacky”.

Cheers

What exactly does not work? In UI Only mode, input is not processed by the Player Controller. You’ve implemented the ANY key in the widget - you’re testing out the wrong thing if the goal is to:

prevent the character from moving when the widget is open.

Characters are usually asked to move by the PC or the Pawn which Input UI Only mode would prevent. This is enough:

e

The controller is no longer processing input. Whether you add a widget or not does not even matter.


is not capturing the keys.

Input in widgets is handled (and, optionally, consumed) by overriding onKeyDown / onKeyUp. What does it even have to do with character movement? I sense a great deal of confusion here.

1 Like

An easy on I like to use for most my UI menus is *set game paused

1 Like

If your referring to the UI as not capturing keys, you may need to set the focus to that widget on construction, and add some overrides for on key pressed to give desired controls to the UI, also ensure the UI and any children are hit testable, or they won’t respond to mouse clicks

1 Like

Hi! thanks for all the answers!!
Finally, I found the way of doing it.
Cheers