Difference between revisions of "Mouse Lock API Points of Interest"

From CDOT Wiki
Jump to: navigation, search
(WIN32 API)
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
I suggest looking at widget/src/*/nsWindow.cpp for starters. It seems like the OS-Specific mouse stuff is all done in there.
 
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==
 
==WIN32 API==
Line 8: Line 10:
 
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.
 
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.
 
* http://pastebin.com/gNmh1uhz
 
* http://pastebin.com/gNmh1uhz
* http://pastebin.com/3YBfXxM2(requires adding the mMousePos and mMouseLock member variables)
+
* or [http://pastebin.com/3YBfXxM2 http://pastebin.com/3YBfXxM2](requires adding the mMousePos and mMouseLock member variables)

Latest revision as of 13:43, 11 November 2011

This page is for tracking different parts of the Firefox code that relate to the mouse in different ways.

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.