4.7 Lock mouse to viewport problem

I am having a similar problem. I’m trying to set up a basic toggle to go back and forth between using mouse to move cursor, and using mouse to move camera, and I don’t want mouse to be locked to viewport, but it stays locked at first anyway. Basically, it behaves exactly as explained, whether you set it to locked or unlocked.
Also, when I try to toggle back to using mouse to move camera, I also have to click again to be able to move camera. That’s really annoying and non-intuitive, and completely defeats purpose of trying to set up a simple toggle.