There is no built in way to do this, there isn't any browser API either, so anything you do will likely be imperfect.
If I were to cobble something together I would probably look into a combo between the on movement trigger and a timer.
Whenever the trigger takes place start a timer, if the trigger happens again before the timer completes, reset the timer and assume the mouse is moving. If the timer manages to complete before on movement is triggered again, the you can assume the mouse is not moving.
You would need to try out different lengths of time to see what works for you.