Answer the question
In order to leave comments, you need to log in
How to reset timer on mouse event?
Good day everyone!
I ask for your advice on this issue. An event occurs in my timer program. But I need it to happen after a given time only if the user does not perform any actions (specifically, there are no mouse events). I decided to act from the opposite: an event occurred - the timer was reset (to start counting again). I create mouse events (there is a click, etc.), I specify that the timer stop, or even turn it off, but ... No matter how you use the mouse in the program, the event still occurs after a specified time.
Answer the question
In order to leave comments, you need to log in
Enter the boolean variable "canceled". On the click event, set it to true, and in the timer, check it for false before executing.
If google didn't help, then that's the obvious solution, isn't it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question