Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // For widget/src/windows/nsWindow.cpp, in nsWindow::DispatchMouseEvent
- RECT windowRect;
- ::GetWindowRect(mWnd, &windowRect);
- nsIntPoint mousePos;
- mousePos.x = windowRect.right/2;
- mousePos.y = windowRect.bottom/2;
- RECT mouseRect = { mousePos.x, mousePos.y, mousePos.x, mousePos.y };
- ClipCursor(&mouseRect); // Forces the mouse to be only within that rectangle on the screen, giving it no width and height means it's locked.
Advertisement
Add Comment
Please, Sign In to add comment