Handling mousemove more delicately

Mousemove fires very frequently and is a sure way of killing any app's FPS.  This tweak makes sure it is only bound when it is in fact needed.
Merge pull request #2377 from TheSisb/master

Handling mousemove more delicately