Started handling "inversion". When moving the mouse fast, inversion from top to bottom and from left to right is not handled correctly yet (the frame moves when it should not).