We are attempting to gate input to multiple UMG buttons on a menu, but seeing undesired behavior. For example:
Button1 and Button2 exist in MenuWidget’s scene, and Focusable is set to false:
Hold Button1
Hold Button2 (both actions allowable via MenuWidget’s visibility settings)
Release Button1 (Onclick fired, which calls MenuWidget.SetVisibility(HitTestInvisible) therefore disabling input on the menu)
Release Button2 (Onclick fired, undesired behavior, MenuWidget is HitTestInvisible)
It appears that Pressed events go a different route than Released events, which bypasses checks against MenuWidget’s visibility. We are currently looking at intercepting the OnClick event (either on UButton, or a wrapper blueprint), checking against MenuWidget’s visibility, and then proceeding accordingly, but this doesn’t seem like the best approach. Would your UMG experts have insight into a better solution?
How does Widget Focusablility play into this?
Thank you.
Edit:
After some further investigation into the role of IsFocusable, it appears that buttons with IsFocusable are inconsistent in their reproduction of this issue:
Hold Button1
Hold Button2
Release Button1 (OnClick fires, calls Menu.SetVisibility(HitTestInvisible))
Release Button2 (OnClick DOESN’T fire as desired)
but the second repro attempt shows:
Hold Button1
Hold Button2
Release Button1 (OnClick fires, calls Menu.SetVisibility(HitTestInvisible))
Release Button2 (OnClick fires)
IsFocusable appears to manipulate the mouse/touch capture of the buttons, leaving them in a state that affects the next repro attempt.