There is an option to constrain the mouse to the window. It's down the bottom, I think in the gameplay tab.