Why does setting input focus re-trigger enhanced input action?

I have a simple pause menu that is activated by an enhanced input action - when the game is not paused it adds the widget, when the game is paused it removes the widget. However, I’m using a controller and trying to set focus on the pause widget and this is causing an odd bug. If I hold the pause button, the action is triggered, creates the widget, and the moment a “set focus” node is called the enhanced input action will fire again (despite not having been released). This means the widget is only only screen for a few frames before the unpause function is toggled.

Weirder, if you then release the input and press it again, it will be ignored - the event doesn’t fire. After this non-responsive press-and-release the input event will start firing as normal again.

I’ve tried using the clear input toggles on the “set input mode” settings but to no avail. I’ve even put the focus setting node on a delay, just to confirm that it’s the setting of the focus that’s “clearing” the input state and making it retrigger when it shouldn’t. I press and hold the button, the widget is added to the screen, and the instant the delay finishes and the “set focus to button” node is hit the held button suddenly fires off its event again.

Any help on this? I’m pretty new to Unreal so might be going about this wrong but the non-responsive second press seems like a bug regardless.

I am also experiencing this bug and would appreciate a fix or even a work-around. :slightly_smiling_face:

I’m losing my mind over this, anyone knows a workaround? If you hold button on gamepad after you change focus to the widget, and then return to the game, it keeps triggering and releasing in a loop

Found a hack that worked for me after some trial and error.

It’s basically using a bool to absorb the erroneous inputs while holding the button.

Enhanced input events don’t work for this (at least with my level of understanding of them), so I overrode the OnKeyDown and OnKeyUp functions in the pause menu widget.

I apologize that you’ll have to study the images to get context and piece it together until I have more time to write this out in clear detail.

But after this implementation, pause/unpause works once each time the input is pressed. Holding the input does not toggle the menu again for either pause or unpause.

In my case, I wanted a quality of life feature in which the player can also press the gamepad special right button to unpause, in addition to the option to select the “resume” button from the pause menu.