LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

prevent double clicking action on mouse

Hi,
How do I prevent the operator mistake of clicking more than once on a button and and causing the action to repeat again. I'm using event structure with "value change" event.
Thanks
dphan128
 
0 Kudos
Message 1 of 22
(5,897 Views)
You can disable the control in the value change event (using a property node), then enable it again after a timeout or after a process has completed, for example.
Message 2 of 22
(5,883 Views)

Thank you Altenbach. I tried what you recommended . But my program only work half of the time with that approach (inconsistent). Must be something else with my code that I need to sort it out on my own.

I was wonder if event structure can be set to accept the first click only and ignore any click after that.

dphan128

0 Kudos
Message 3 of 22
(5,865 Views)
You can programmatically filter out double clicks using Filter Events in the Event Structure. You can usually tell Filter Events by the "?" in their name. For instance, "Mouse Down?" is a filter event whereas "Mouse Down" is a notify event. There is a big difference between the two. Filter events allow you to change the event data before they get processed, whereas notify events happen after the processing occurs.

So you can actually register for a "Mouse Down?" event for your control and alter the Mods data that contains what type of mouse click gets registered. Specifically, you can set Double Click to false for your control. This will get processed before the Value Change event case.

Message Edited by Jarrod S. on 02-27-2007 01:31 PM

Jarrod S.
National Instruments
0 Kudos
Message 4 of 22
(5,858 Views)
What I said does technically remove the Double Click, but it doesn't keep two Value Changes from being recorded. You might try some form of the following, which does only register one value change for either a single click or a double click.

Message Edited by Jarrod S. on 02-27-2007 01:37 PM

Jarrod S.
National Instruments
0 Kudos
Message 5 of 22
(5,856 Views)
It is not clear if this is suitable for dphan128


@dphan128 wrote:
How do I prevent the operator mistake of clicking more than once on a button and and causing the action to repeat again. I'm using event structure with "value change" event.

Clicking more than once is "potentially" different to a double-click. We need more information on the application. 🙂
 
 

 
0 Kudos
Message 6 of 22
(5,845 Views)
Agreed, more info would be helpful. Just guessing exactly how often the user should or shouldn't be able to click on a control is tricky to say the least. Perhaps a more passive aggressive approach would work for your average operator.
Jarrod S.
National Instruments
0 Kudos
Message 7 of 22
(5,836 Views)

I just want the first click to be acknowledged and any additional click after that will be ignored, until the process is completed executed and then ready for the new click again.

dphan128

 

0 Kudos
Message 8 of 22
(5,816 Views)
OK, that's not a "double-click" as defined by the OS. Use my suggestion. have you tried?
Message 9 of 22
(5,808 Views)

Altenbach,

Yes, I have tried. But the result was not consistent as expected (see my earlier response).

dphan128

0 Kudos
Message 10 of 22
(5,791 Views)