0

my question is actually quite easy but I get stuck with this issue.

I want to set timer to 2 second and then check if the mouse is still in the same poit as previous.

example: I detect the point of the mouse as (250, 500) and then put timer to 2 secs and check again where is the pointer now.

would appreciate your help :)

Adi Fynn
  • 1
  • 2
  • Do check this https://stackoverflow.com/questions/3698635/getting-cursor-position-in-python/24567802 to get mouse coordinates. You just need to compare the coordinates every 2 seconds to achieve your desired result. – Venkat Apr 07 '21 at 11:08
  • Detecting the mouse position is not the problem for me. the question is how can I detect the mouse position, set timer to 2 secs and then chech again – Adi Fynn Apr 07 '21 at 12:07

1 Answers1

0

you can use time.sleep in cycle for

import time

for i in range(0,2):# range: 0,1 = 2 iteration = 2 sec
    time.sleep(1)
vieegg
  • 26
  • 2