SHARE
TWEET

Untitled

a guest Nov 11th, 2011 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.   nsIntPoint oldMousePos = mMousePos;
  3.   mMousePos = eventPoint + WidgetToScreenOffset();
  4.  
  5.   mMovement.x = mMousePos.x - oldMousePos.x;
  6.   mMovement.y = mMousePos.y - oldMousePos.y;
  7.  
  8.   fprintf(stderr, "Mouse Movement: %d,%d\n", mMovement.x, mMovement.y);
  9.  
  10.   if (mMouseLock == true) {
  11.       RECT windowRect;
  12.       ::GetWindowRect(mWnd, &windowRect);
  13.       bool mouseChanged = false;
  14.       if (mMousePos.x != windowRect.right/2) {
  15.         mMousePos.x = windowRect.right/2;
  16.         mouseChanged = true;
  17.       }
  18.       if (mMousePos.y != windowRect.bottom/2) {
  19.         mMousePos.y = windowRect.bottom/2;
  20.         mouseChanged = true;
  21.       }
  22.       if (mouseChanged == true)
  23.         SetCursorPos(mMousePos.x, mMousePos.y);
  24.       fprintf(stderr, "In nsWindow::DispatchMouseEvent\nCursor: %d,%d\nLast: %d,%d\n\n", mMousePos.x, mMousePos.y, oldMousePos.x, oldMousePos.y);
  25.   }
  26.  
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top