title: Handling Camera-Style Mouse Movement in Javascript (enabling continuous mouse movement)
body: <p><strong>The idea:</strong> I'm creating a simple WebGL script (using mrdoob's wonderful three.js) that allows the user to control a camera in a world of objects. The camera is supposed to simulate traditional first person shooter cameras (reference Team Fortress 2, for example). That is, the camera moves only when the mouse moves. </p>
  
  <p><strong>The issue:</strong> in Javascript, the only way to detect mouse movement is if the cursor itself moves. By comparison, FPS games don't show the cursor -- they only base the movement of the camera off of how the mouse itself moves. So, you can move your mouse all over the mousepad in any direction and it always works. </p>
  
  <p>On a browser though, since camera movement is based on the cursor, you can't move but so far. When the cursor hits the edge of the screen, the user is unable to look any further in that direction (e.g. you move your mouse to the left edge of the screen, you can't look left any more).</p>
  
  <p><strong>The solution:</strong> I've thought of two solutions, but neither of which I know how to implement. Either </p>
  
  <ol>
  <li><p>After the mouse is moved, the javascript resets it to the center of the screen. That way, after every mouse movement the player is free to again move in any direction. The issue with this is that, based on the research I've done, Javascript is unable to control the position of the user's mouse (understandably, as it would be an incomparable nuisance on malignant sites).</p></li>
  <li><p>Or, the mouse "wraps" around the screen. Meaning, when the user reaches one edge of the screen, the mouse would simply continue on to the other side of the screen. (see: <a href="http://www.digicowsoftware.com/detail?_app=Wraparound">http://www.digicowsoftware.com/detail?_app=Wraparound</a>) However, it appears that this too is not an inherent capability of javascript, but instead is only something a third party program could solve.</p></li>
  </ol>
  
  <p>So, does the problem make sense? If so, is there any way I can implement the above solutions, or is there another one I'm missing?</p>