Cursor trapped in viewport when simulating game

When I simulate my game while inside the level viewport the cursor gets trapped inside the window but only when I hold the right mouse button to aim. but it is really annoying to fly around this way.