LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture the click of a mouse button for more than a second?

HI,
I want to be able to perform an extended action once the mouse button is clicked (i.e. the mouse is clicked and I want to draw a circle), but the problem is that once the mouse button is released I want the circle to stay drawn (unless perhaps a different button : refresh, is hit then the circle can disappear) So the problem is that I am not sure what to wire to the case statement where the circle is drawn? Any suggestions of how to do this?
0 Kudos
Message 1 of 4
(2,702 Views)
Using shift registers, you can make your graph or whatever you are using only update in some cases, mantaining the data given before untill one of that cases executes.
Hope this helps
0 Kudos
Message 2 of 4
(2,702 Views)
Are you clicking on a Boolean on the front panel? If so, then just wire the Boolean terminal to the case statement. If the control's mechanical action is set to Latch When Released, put the draw routine in the case statement's True state and leave the False state empty.
0 Kudos
Message 3 of 4
(2,702 Views)
If you are working within a picture control, you can create a property node from the control. Right click on the property node and choose property->mouse. This is a cluster that includes mouse X and Y position as well as a boolean for "button down". This stays true as long as a button on the mouse is held down. So in your case statement, use something like "While button down = TRUE". Feed your picture through a shift register, so anything that you add inside the while loop will not be lost.

Rob
0 Kudos
Message 4 of 4
(2,702 Views)