Changes

Jump to: navigation, search

Mouse Lock API Points of Interest

61 bytes removed, 14:43, 11 November 2011
no edit summary
I suggest looking at widget/src/*/nsWindow.cpp for starters. It seems like the OS-Specific mouse stuff is all done in there.
 
Try researching in different OS APIs about setting the mouse cursor position directly, it should turn up some interesting results.
==WIN32 API==
Here's some code that actually locks the mouse into a rectangle with no width or height in the center of the screen in WIN32.
 RECT windowRect;* http::GetWindowRect(mWnd, &windowRect);nsIntPoint mousePos;mousePos.x = windowRect//pastebin.rightcom/2;gNmh1uhzmousePos* or [http://pastebin.y = windowRectcom/3YBfXxM2 http://pastebin.bottomcom/2;RECT mouseRect = { mousePos.x, mousePos.y, mousePos.x, mousePos.y };ClipCursor3YBfXxM2](&mouseRect); // Forces requires adding the mouse to be only within that rectangle on the screen, giving it no width mMousePos and height means it's locked.mMouseLock member variables)
4
edits

Navigation menu