You can control this behaviour by returning Handled / Unhandled replies when overriding mouse events:
- Handled - the input is consumed and neither the widget underneath or the game will be notified
- Unhandled - the input is not consumed and will tunnel to the elements underneath, if no other widget Handles it, the input will eventually arrive at the Player Controller a.k.a. the Game (unless we’re in the UI-only input mode, of course)
In addition, I’m intercepting the clicks here, giving this widget a chance to act accordingly, depending on which button was clicked.
In this very case:
- LMB will call the Clicked event and terminate (handled)
- RMB will call the Clicked event and carry on, looking for another input recipient (unhandled)
- other mouse buttons will not call the event and also carry on (unhandled); you could middle-mouse click on a Visible widget and still have the player controller rotate the camera, for example
One note, it gets somewhat tricky with Buttons as they very hungrily consume input. Essentially, if a click lands on a button, the UMG will think you really meant it and just eat it. There’s a feature called Precise Click but I don’t think that’s what you’re after here. Or is it specifically for buttons?
After dealing with UMG for years now, i’m really against using buttons for anything other than simple click & forget or debug. Totally biased.
Widget overrides sit here: