Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nsIntPoint oldMousePos = mMousePos;
- mMousePos = eventPoint + WidgetToScreenOffset();
- mMovement.x = mMousePos.x - oldMousePos.x;
- mMovement.y = mMousePos.y - oldMousePos.y;
- fprintf(stderr, "Mouse Movement: %d,%d\n", mMovement.x, mMovement.y);
- if (mMouseLock == true) {
- RECT windowRect;
- ::GetWindowRect(mWnd, &windowRect);
- bool mouseChanged = false;
- if (mMousePos.x != windowRect.right/2) {
- mMousePos.x = windowRect.right/2;
- mouseChanged = true;
- }
- if (mMousePos.y != windowRect.bottom/2) {
- mMousePos.y = windowRect.bottom/2;
- mouseChanged = true;
- }
- if (mouseChanged == true)
- SetCursorPos(mMousePos.x, mMousePos.y);
- fprintf(stderr, "In nsWindow::DispatchMouseEvent\nCursor: %d,%d\nLast: %d,%d\n\n", mMousePos.x, mMousePos.y, oldMousePos.x, oldMousePos.y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement