Would that completely break down if your cursor is moved by something other than the mouse? (An automation script, a game that locks the cursor to the middle of the screen, etc.)
I think that's to prevent the cursor from hitting the edge of the screen and the player being unable to turn further (though I'm not certian if every game does it this way)