How can I get buttons to accept the correct "click" input?

I have an InputActionTable containing my Confirm and Cancel buttons, then an InputData blueprint setting these to Default Click Action and Default Back Action, respectively. (I got to this point by following the Introduction to Common UI video on Inside Unreal)

The back button works as expected with my menu, however I can’t get the menu buttons to recognise my Confirm input as a click, instead they respond to the Space Bar which I did not set anywhere. Does anyone know why this is or how I can fix it?

1 Like

Hey there @AbelGray! Common issues I see that can cause this include creating multiple UI, or the button not being hit testable, or being obscured by something that is hit testable etc. Could we see the UI itself and it’s spawning logic? Does the button print anything on it’s hover events?

It also sounds like the automatic UI navigation. If you don’t want it to be keyboard focusable, just until the Is Focusable bool on the button itself.

Hi, thanks for your response! I do want the menu to be navigatable with the keyboard (and gamepad), my issue is that I want to click using my Confirm button rather than the default Space Bar/Face Button Bottom.

The buttons are set to ‘Not Hit Testable (Self Only)’ but I tested all the options - ‘Visible’ stops the space bar from working and the others prevent the button being focused or even showing up.

I’ll attach all the relevant blueprints and a gif showing how the menu works, any further help would be greatly appreciated, thanks again!





working-menu

Sorry I missed the actual UI spawn logic, this fires at BeginPlay, the first node creates the base which the menu gets pushed to.

I should mention that I went through all my UI and made sure nothing else is hit testable, it didn’t seem to change anything.

Perhaps I should be setting up my own confirm logic? Any guidance with that would be appreciated - I can’t see an equivilent to the overridable OnHandleBackAction nor any way to bind an event to the Confirm input action.

I’m just not sure I understand the point in setting input data for “Default Click Action” if it’s not to replace the default click action.

You’re all good! I had to set up a little UI testing scene to see if for some reason your input was being ignored for a reason. (I work with gameplay programming more than UI). I’m actually also having a bit of trouble forcing the default as a click. I think we’re both missing something. Going to keep playing around in my scene until I discern what we’re missing.

Thanks for going to such lengths! It’s at least good to know I’m not doing something completely stupid, I’ll keep experimenting too.

This doesn’t feel like the “correct” solution but I found a functionally identical workaround:

The only way I managed to get the Confirm input to interact with my buttons was through the “Triggering Input Action” setting, which clicks the assigned button regardless of what is focused and only works for one button at a time. However you can set it at runtime, so by switching it out when a button is focused/unfocused, you can make it click on whichever button is focused at the time.

2 Likes