title: Allow mousepointer to be outside of screen boundaries
body: <p>I'm making a game using XNA 4.0 and c#. 
  I just made my camera class and it's almost working as expected, except for one thing.
  I can move with my mouse to rotate the camera but the problem is that when I get to the border of the screen, the mouse stops and so does the camera movement.</p>
  
  <p>Is there any way to allow the mouse pointer to be outside of the screens boundaries to be able to keep tracking the pointer? Or is there any simpler way around?</p>
  
  
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using Microsoft.Xna.Framework;
  using Microsoft.Xna.Framework.Audio;
  using Microsoft.Xna.Framework.Content;
  using Microsoft.Xna.Framework.GamerServices;
  using Microsoft.Xna.Framework.Graphics;
  using Microsoft.Xna.Framework.Input;
  using Microsoft.Xna.Framework.Media;
  
  public class ArcBallCamera
  {
      private float speeder = 100;
      public ArcBallCamera(float aspectRation, Vector3 lookAt)
          : this(aspectRation, MathHelper.PiOver4, lookAt, Vector3.Up, 0.1f, float.MaxValue) { }
  
      public ArcBallCamera(float aspectRatio, float fieldOfView, Vector3 lookAt, Vector3 up, float nearPlane, float farPlane)
      {
          this.aspectRatio = aspectRatio;
          this.fieldOfView = fieldOfView;
          this.lookAt = lookAt;
          this.nearPlane = nearPlane;
          this.farPlane = farPlane;
      }
  
      /// &lt;summary&gt;
      /// Recreates our view matrix, then signals that the view matrix
      /// is clean.
      /// &lt;/summary&gt;
      public void ReCreateViewMatrix()
      {
  
          //Calculate the relative position of the camera                        
          position = Vector3.Transform(Vector3.Backward, Matrix.CreateFromYawPitchRoll(yaw, pitch, 0));
          //Convert the relative position to the absolute position
          position *= zoom;
          position += lookAt;
  
          //Calculate a new viewmatrix
          viewMatrix = Matrix.CreateLookAt(position, lookAt, Vector3.Up);
          viewMatrixDirty = false;
      }
  
  
  
  
      /// &lt;summary&gt;
      /// Recreates our projection matrix, then signals that the projection
      /// matrix is clean.
      /// &lt;/summary&gt;
      public void ReCreateProjectionMatrix()
      {
          projectionMatrix = Matrix.CreatePerspectiveFieldOfView(fieldOfView, AspectRatio, nearPlane, farPlane);
          projectionMatrixDirty = false;
      }
  
      #region HelperMethods
  
      /// &lt;summary&gt;
      /// Moves the camera and lookAt at to the right,
      /// as seen from the camera, while keeping the same height
      /// &lt;/summary&gt;        
      public void MoveCameraRight(float amount)
      {
          Vector3 right = Vector3.Normalize(LookAt - Position); //calculate forward
          right = Vector3.Cross(right, Vector3.Up); //calculate the real right
          //right.Y = 0;
          right.Normalize();
          LookAt += right * amount;
      }
  
      /// &lt;summary&gt;
      /// Moves the camera and lookAt forward,
      /// as seen from the camera, while keeping the same height
      /// &lt;/summary&gt;        
      public void MoveCameraForward(float amount)
      {
          Vector3 forward = Vector3.Normalize(LookAt - Position);
         // forward.Y = 0;
          forward.Normalize();
          LookAt += forward * amount;
      }
  
      /// &lt;summary&gt;
      /// Moves the camera and lookAt up or down,
      /// LOL
      /// &lt;/summary&gt;        
      public void MoveCameraUp(float amount)
      {
          Vector3 up = Vector3.Normalize(LookAt - position);
          up = Vector3.Cross(up, Vector3.Left);   //Calculate the REAL FUCKING UP/DOWN
          up.X = 0;
          up.Z = 0;
          up.Normalize();
          LookAt += up * amount;
      }
  
  
      #endregion
  
      #region FieldsAndProperties
      //We don't need an update method because the camera only needs updating
      //when we change one of it's parameters.
      //We keep track if one of our matrices is dirty
      //and reacalculate that matrix when it is accesed.
      private bool viewMatrixDirty = true;
      private bool projectionMatrixDirty = true;
  
      public float MinPitch = -MathHelper.PiOver2 + 0.3f;
      public float MaxPitch = MathHelper.PiOver2 - 0.3f;
  
      private float pitch;
      public float Pitch
      {
          get { return pitch; }
          set
          {
              viewMatrixDirty = true;
              pitch = MathHelper.Clamp(value, MinPitch, MaxPitch);
          }
      }
  
      private float yaw;
      public float Yaw
      {
          get { return yaw; }
          set
          {
              viewMatrixDirty = true;
              yaw = value;
          }
      }
  
      private float fieldOfView;
      public float FieldOfView
      {
          get { return fieldOfView; }
          set
          {
              projectionMatrixDirty = true;
              fieldOfView = value;
          }
      }
  
      private float aspectRatio;
      public float AspectRatio
      {
          get { return aspectRatio; }
          set
          {
              projectionMatrixDirty = true;
              aspectRatio = value;
          }
      }
  
      private float nearPlane;
      public float NearPlane
      {
          get { return nearPlane; }
          set
          {
              projectionMatrixDirty = true;
              nearPlane = value;
          }
      }
  
      private float farPlane;
      public float FarPlane
      {
          get { return farPlane; }
          set
          {
              projectionMatrixDirty = true;
              farPlane = value;
          }
      }
  
      public float MinZoom = 1;
      public float MaxZoom = float.MaxValue;
      private float zoom = 1;
      public float Zoom
      {
          get { return zoom; }
          set
          {
              viewMatrixDirty = true;
              zoom = MathHelper.Clamp(value, MinZoom, MaxZoom);
          }
      }
  
  
      private Vector3 position;
      public Vector3 Position
      {
          get
          {
              if (viewMatrixDirty)
              {
                  ReCreateViewMatrix();
              }
              return position;
          }
      }
  
      private Vector3 lookAt;
      public Vector3 LookAt
      {
          get { return lookAt; }
          set
          {
              viewMatrixDirty = true;
              lookAt = value;
          }
      }
      #endregion
  
      #region ICamera Members
      public Matrix ViewProjectionMatrix
      {
          get { return ViewMatrix * ProjectionMatrix; }
      }
  
      private Matrix viewMatrix;
      public Matrix ViewMatrix
      {
          get
          {
              if (viewMatrixDirty)
              {
                  ReCreateViewMatrix();
              }
              return viewMatrix;
          }
      }
  
      private Matrix projectionMatrix;
      public Matrix ProjectionMatrix
      {
          get
          {
              if (projectionMatrixDirty)
              {
                  ReCreateProjectionMatrix();
              }
              return projectionMatrix;
          }
      }
      #endregion
  
  
  }
  </code></pre>