[UE5] Widget Input takes over Players Input

In UE4, i couldn’t create keyboard events or input actions. And in UE5 it is now possible.
BUT, After assigning some code to these keys/input actions IN WIDGET, they’re triggering even AFTER REMOVING widget.

How can i disable input consumption after widget removal?

why not?

can you clarify what “removing” the widget means?

If the widget is removed, i.e. removed from parent, it won’t consume input. So I’d double check and confirm that it is getting removed in the way that you think it is.

You can “delete” it or disable input with these methods:


Then it is gone

Or inside the widget

@BIGTIMEMASTER It will still consume input. E.g. create a widget inside the PlayerController. Promote it to variable. Have an AnyKey event with a PrintString. Remove the widget from parent, press AnyKey

4 Likes

Oh yes, after “collect garbage” widget code doesn’t trigger anymore, but now player’s code doesn’t trigger. How to enable player’s input?

How does your code look like? Usually you can enable it like this:
image

Or show / tell us what you want to do.

1 Like

This is on character. Pressed “E” creates widget.
image

And on created widget, if i press “E” it removes self.


After removing widget, my character can no longer creates widget (first “E”).
How do i fix that?

Look at this example. You will have to disable ConsumeInput for your InputAction. And if you do this, the widget will stay, because you use the same key for both events. It will always be like “Destroy, Create again” when you press it.
WidgetInput.zip (826.1 KB)

1 Like

wai whaaa? Weird behavior if you uncheck Consume Input, they both trigger. So there is no fix of that?

Well, you usually would not use the same input like that. Maybe only in the character with a FlipFlop node. What do you want to achieve?

Something like, escape button for Menu pop up and close on the same button.

Then use a FlipFlop node.

1 Like

Oh, i’m dumb. The whole time, i was using “right mouse button” for testing. Apparently this is causing the problems with focusing on widget inside editor.

Long story short: Use Collect Garbage and uncheck Consume Input in widgets.
And make sure your widget isn’t referenced anywhere, else garbage collection won’t happen.

3 Likes