How to test if the mouse cursor is inside the window?

I’m trying to determine whether the mouse is inside the current viewport of the window so that I can disable edge-of-screen scrolling when this occurs (it’s something like an RTS game). I’m calling APlayerController::GetMousePosition(), but the X and Y coords it returns appear to already be clamped inside the viewport.

I’m not seeing any functionality to get the raw, unclamped position, or simply to return whether or not the mouse pointer is outside the viewport. How do I do this?

I’ve found the following will return -1, -1 when the mouse is outside the view port:

FIntPoint Mouse;
if (GEngine->GameViewport)
{
	GEngine->GameViewport->GetMousePos(Mouse);
}
else
{
	Mouse.X = -1;
}

if (Mouse.X != -1)
{
	// The mouse is in the viewport
}

I don’t know if this is the right/best way to do it, but it seems to work for me.