Run Some Code Only When The Mouse Is Stationary?

Is there a way to detect if the mouse is moving such that some code is run only when the mouse is stationary?

I did something like this ~3 years ago:

2 Likes