How to correctly clear mouse input