Detecting when the mouse is not moving

后端 未结 7 721
逝去的感伤
逝去的感伤 2021-01-31 05:06

I am able to find the cursor position. But I need to find out if the mouse is stable. If the mouse wasn\'t moved for more than 1 minute, then we have to alert the user.

7条回答
  •  情话喂你
    2021-01-31 05:31

    You could use this script/snippet to detect the mouse pointer position and "remember" it. Then use a timer "setTimeout(...)" to check the position let's say every second and remember that time.

    If more than one minute passed and the position hasn't changed, you could alert the user.

提交回复
热议问题