LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous mouse events

I'm trying to cause a circle drawn in an IMAQ image field to grow for however long the mouse button is held down over the field, then persist at the last size once the mouse button is released. So far all parts of this work except for the circle growing while the mouse is held down. (The function is just supposed to iterate a value for the x,y parameters for the bounding box of the circle). LabView picks up on the Mouse Down event once, then the Mouse up event once, no matter how long I hold down the mouse button. Is there a way to repeatedly trigger an event for Mouse Down while it's being held down (and not clicked repeatedly)? Extra sweet if I can time delay the event trigger rate (say, once every 10ms) without tying up the CPU in wait mode.
0 Kudos
Message 1 of 5
(3,223 Views)

Why don't you use the "mouse move" event ?

Alternatively you can fire a user event every 10msec. Dynamically register it, when mouse down. Dynamically unregister it, when mouse up.

Message 2 of 5
(3,217 Views)
I want the circle to grow while the mouse is down whether or not the mouse is being moved. I'll try dynamically registering it, thanks.
0 Kudos
Message 3 of 5
(3,214 Views)
You can use the timeout event. Pass the actual timeout value using a shift register. When the mouse down event is triggered, change the value in the SR to 10 (or whatever). When the mouse up event is triggered, change it to -1 and the timeout event will stop executing.

___________________
Try to take over the world!
Message 4 of 5
(3,197 Views)
Thanks! That should work perfectly. Kind of kicking myself for not thinking of that...
0 Kudos
Message 5 of 5
(3,186 Views)