'Set Ignore Look Input' delayed response

I’am also trying to achieve a similar system for camera movement. If press and hold the right mouse button I can move the camera, if I release it I can normally move the mouse and interact with the game world / HUD.
However, the mouse is blocked at the edges of the screen and therefore prevents all other camera movement. How can I prevent this?