NativeOnMouseButtonDown never called in custom UUserWidget.

Hi!

I have a custom UMG widget (UUserWidget) which implements NativeOnMouseButtonDown. However the event seems to never be called. I have a button widget as child in the widget which is just for the appearance. I can’t use it’s events since I need the parameters in NativeOnMouseButtonDown to determent what to do. E.g. the button will have an other function if “alt or control is pressed simultaneously”.

Anyone how knows how you can solve this issue? I’m not completely sure I understand the event path in slate and UMG. Thought the event would be passed down the chain through the UUserWidget’s native methods, doesn’t seems to be the case though.

Ex:

FReply UMyWidget::NativeOnMouseButtonDown(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent)
{
	bool bAltDown= InMouseEvent.IsAltDown();
	bool bCtrlDown = InMouseEvent.IsControlDown();

	...
}

Does the button inside the widget fill the entire space of the widget? If so, the button probably “steals” the event and processes it, without the parent widget getting a chance to process the event.

Try selecting the button in the UMG editor, and select “Self Hit Test Invisible” as visibility. This will disable the buttons interaction with the mouse.

Also make sure that the parent Widget (the one deriving from UMyWidget) has visibility “Visible” rather than “Self Hit Test Invisible”, which seems to be the default quite often.