Changes

Jump to: navigation, search

Mouse Lock Implementation FAQ

821 bytes added, 18:27, 20 November 2011
no edit summary
</pre>
===How can I stack trace events in Firefox in Windows using Visual Studio?===
 
'''Answer 1:''' The answer is going to assume you know the basics of debugging on Visual Studio, like how to start debugging, step into, step out, step over, etc. If you haven't already follow the instructions on this [http://benoitgirard.wordpress.com/2011/05/27/using-visual-studio-2010-ide/ site]. You don't have to do the optional part. Make sure you build your debug version of Firefox before this. Once you've completed the tasks, find out where you want to put your break point, (use [http://mxr.mozilla.org/ mxr] or [http://dxr.mozilla.org/ dxr]), and then hit debug. When you rebuild Firefox, you won't need to do the steps all over again, your solution explorer will automatically update itself.
 
See also https://cs.senecac.on.ca/~david.humphrey/writing/debugging-firefox.html, which is old, but likely still helpful.
===How do I programatically set the mouse cursor position?===
'''Answer:''' See how SynthesizeNativeMouseEvent does it on Windows:
===How can I stack trace events in Firefox in Windows using Visual Studio?===<pre>5941 nsresult'''Answer 15942 nsWindow::''' The answer is going to assume you know the basics of debugging on Visual StudioSynthesizeNativeMouseEvent(nsIntPoint aPoint, like how to start debugging5943 PRUint32 aNativeMessage, step into5944 PRUint32 aModifierFlags)5945 {5946 RECT r;5947 ::GetWindowRect(mWnd, step out, step over, etc. If you haven't already follow the instructions on this [http&r);5948 :://benoitgirardSetCursorPos(r.wordpressleft + aPoint.com/2011/05/27/using-visual-studio-2010-ide/ site]x, r. You don't have to do the optional parttop + aPoint. Make sure you build your debug version of Firefox before this. Once you've completed the tasksy);5949 5950 INPUT input;5951 memset(&input, find out where you want to put your break point0, sizeof(use [http://mxrinput));5952 5953 input.type = INPUT_MOUSE;5954 input.mozillami.org/ mxr] or [httpdwFlags = aNativeMessage;5955 :://dxr.mozilla.org/ dxr])SendInput(1, and then hit debug. When you rebuild Firefox&input, you won't need to do the steps all over again, your solution explorer will automatically update itself.sizeof(INPUT));5956 5957 return NS_OK;5958 }</pre>

Navigation menu