Pseudo 3D Examples

You don’t need to cap the mouse position, just the variables that copy the mouse position.
In pseudo code could be as is:
variable Xcapped = clamp (MouseX, 0 , WindowWidth)
variable Ycapped = clamp (MouseY, 0 , WindowHeight)

You might calculate the difference between the center of the camera and the mouse position to find the angle of movement.

And there is an action to hide the cursor:
imagen