B
B
Bogdan Borovkov2015-08-19 10:23:54
Webkit
Bogdan Borovkov, 2015-08-19 10:23:54

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

3 answer(s)
A
ar4ebaldello, 2015-08-19
@ar4ebaldello

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?

S
sivabur, 2015-08-19
@sivabur

We are waiting for the code!

A
Ai Lab, 2015-08-19
@vpuhoff

where the mouse will be "when it works", in your program or not, if not, then you need to globally intercept events, if in the program, then everything depends on the event, nothing can be said for sure without code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question