Cursor position relative to a widget element or left-top corner position of the widget

If anyone is still interested, this can be achieved using this piece of code (I am using it inside NativeOnMouseMove function, but I reckon you can use this in blueprint or other function if you have geometry and mouseEvent)

FReply WidgetClass::NativeOnMouseMove(const FGeometry& geometry, const FPointerEvent& mouseEvent)
{
    const FVector2D localPosition = geometry.AbsoluteToLocal(mouseEvent.GetScreenSpacePosition());
    ....
}
1 Like