No this flag does only indicate if the mouse pointer is in your application window or not.
It does not allow you to make the mouse "stick" to your game window.

But what you can do with this flag is: whenever a mouse click (e.g.) occures or you use mouse_force somewhere, you can check the mouse_valid flag before letting the action happen.
So if your character should only turn when the mouse pointer is inside the game window you could use the following snippet:
Code:
...
if(mouse_valid)
{
  my.pan += 8 * mouse_force.x * time_step;
}
...



Hope this explains it a little bit.