LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Double clicking an intensity graph to call an event

I am trying to make a certain sequence of events happen if a user double clicks an intensity graph. I didn't notice a 'double click event' just mouse up and downs. Is there a way to recognize a double click if it occurs within a pixel range or on an intensity graph?
0 Kudos
Message 1 of 6
(3,725 Views)
Hi.
Indeed, there is no built in event to catch a double click, but you can use any of the "single click" events to build yourself your own double-click detector, as shown in the attached VI. What I do there is set the value of a shift register to 1 when there is a mouse down? event and the shift register had a value of 0 (first click). If there is another mouse down? event before the timeout (which you can set to whatever you want), I consider that a double click, and execute whatever code you want for a double click. If the timeout passes, the user didn't click twice on the graph fast enough to be considered a double click, so the shift register is set back to 0.
Message 2 of 6
(3,725 Views)
Hi AlejandroZ,

Could you please post a Labview version 6.1 version of your "DetectDoubleClick.vi"? It may be just what I need!

Thank you,
Marilie
0 Kudos
Message 3 of 6
(3,725 Views)
Hello.
Unfortunately, I do not have a LabVIEW version available that would allow me to save the VI in 6.1 version. What I can do is send you a .pdf file with the print out of the diagram.
Notice how the event structure has three event cases. The timeout is there to reset the shift register to zero after some time. This time depends on how fast you want to require the double click to be.
The second event case is for when there are clicks, and the last one is just to stop the VI.
Hope this helps.
Alejandro
0 Kudos
Message 4 of 6
(3,725 Views)
Hi Alejandro,

Thank you for your help!

Have you tried using the Event filter "Mouse Down" - that alows you to select the Boolean item "Mods.Double Click"? That also seems to enable one to detect double clicks?

Kind regards,
Marilie
Message 5 of 6
(3,725 Views)
Hello.
Thank you very much for the tip! I had never seen or used that cluster inside the event structure, and it does detect double clicks. It is much simpler than the solution I had proposed.
Thanks
Alejandro
0 Kudos
Message 6 of 6
(3,725 Views)