Locking the mouse movement to the camera?

Did you look through the example file I linked? I believe it demonstrates how to do this, in the form of a tool being equipped. It could easily be modified to be toggle-able through means other than equipping a tool.

If that example doesn’t end up working out for you, it might also be worth taking a look at this custom ShiftLock controller module.