Sanitising the mouse input data was a good idea, but my implementation sucked. Revise it completely. [originally from svn r5209]