Mouse Lock API Points of Interest
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.