I’m working on an inventory using the vanilla drag and drop features. I don’t want to re-invent the wheel unless no other options are available.
My problem is there seems to be no way of detecting a simple click on an element unless you make it a button, however you can’t drag those.
UE4 already handles a lot of interactions out of the box, but no OnClick event is present anywhere that I’ve seen. Closest thing would the OnDoubleClick event.
I need the widget to be both draggable and clickable, so you can drag it around, but also trigger click events from it.
I’ve been googling for days with no luck.
yeah, i knew that. is what I’m using for the drag detection already (which i mentioned in my initial post…)
Anyway. I got it to doing what I wanted by using the on button up event. I just didn’t know you could leave the event “unhandled” which is what i was missing annoyingly.
In each user widget you want to register clicks on, you can override OnMouseButtonDown/Up.
Note that it requires an event reply as a return value. This is just a way of telling the input handler whether the input has been “handled” or not by this widget. If unhandled, the input can “bubble up”, and be processed by over mouse events. If handled, the input is consumed.