Detecting OnClick (= down and up happening on the same UMG Widget)

UMG offers OnMouseDown/OnTouchStarted/OnKeyDown and OnMouseUp/OnTouchEnded/OnKeyUp (and the native versions for C++ programming). I want to detect if *down and *up happened on the very same widget.

My naive idea is to store the widget where the *down happened in the event (if possible?) and compare this to up. However this causes the need to store a pointer somewhere.

A second possibility would be to GetCursorDelta() of the FPointerEvent but this method heavily depends on widgets size and *down position. So this is worse than the first idea.

Do FGeometry and/or FPointerEvent (or some other class I am not aware of yet) allow a method for detecting if *up happens on the same widget as the causing *down event happened?

After trying FWidgetPath of the FPointerEvent (which isn’t the path of the event but the path of the current widget! :wink: ) and experiments with FPointerEvent::GetCursorDelta() (which didn’t work in my case since other events are called on same widget when entering, so the length of the FVector was zero), I’ve opted in for my first idea.

It works. Basically I’ve done

FReply UMyWidget::NativeOnMouseButtonDown(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent)
{
    //...
    this->inputDownDetected = true;
    //...
}
    
    FReply UMyWidget::NativeOnMouseButtonUp(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent)
    {
        //...
        if (this->inputDownDetected)
        {
            this->DoSomethingOnClick();
        }
        someParentWidget->SetChildrenInputDownDetectedToFalse();

        //...
    }

If there are better/built in ways to handle OnClick, please share. Thanks!