LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate total time of mouse movement

Hi Everyone.

I am doing project on gesture recognition with touchpad. I need to find out the total time of completion of gesture on touchpad. For that I need to calculate total time of cursor movement on laptop touchpad. When cursor starts moving, that time I need to capture time and when it stops also. I need to find out difference between the start time and stop time. Please help me to do this task. Presently I am trying with event structure and timed structure but I am getting only present time only. I tried with counter but unable to get the difference.

0 Kudos
Message 1 of 8
(3,199 Views)

It sounds like you need the time the mouse is down. Is that correct? This simple VI will give you the time in ms that the mouse was down. Is something like this what you are looking for?

0 Kudos
Message 2 of 8
(3,189 Views)

Edited: removed because duplicate post

0 Kudos
Message 3 of 8
(3,189 Views)

Sorry... Again, 

Edited: removed because duplicate post

0 Kudos
Message 4 of 8
(3,187 Views)

Thanks you for giving reply. In your program I am getting time when clicking the mouse but I need to calculate time when mouse start moving. I need to find out the total time of mouse movement for that I need to know start time and stop time. If I get these two times then I can do the difference then I will get the total time of mouse movement.

0 Kudos
Message 5 of 8
(3,166 Views)

Create an event structure which looks for the mouse move event.

This will give you the time that a mouse move starts. If you use the timeout case (i.e. no mouse movements happening) you can compare the time of mouse move starting (move event) with the time that mouse moves stop (timeout event). Subtract one from the other and you have your answer.

 

Ian

0 Kudos
Message 6 of 8
(3,159 Views)

I missed the mouse move event when I saw this earlier, and for some reason I thought the first attempt would give you what you wanted. 

 

Here is a different VI. It uses mouse move event with some logic that remembers the first mouse move event. Otherwise, you won't get the correct time.

0 Kudos
Message 7 of 8
(3,149 Views)

Thank you very much. I will try with your vi.

0 Kudos
Message 8 of 8
(3,135 Views)