Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
3 ratings:
 3 out of 5   

How Do I Distinguish Between a Double-Click Event and a Single-Click Event in LabVIEW?



Primary Software:
Primary Software Version: 8.0
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>LabVIEW Base Development System, LabVIEW Development Systems>>LabVIEW Full Development System

Problem:
I am trying to have a control that executes different code when a user single-clicks or double-clicks. How can I program this in LabVIEW?

Solution:
An event structure can be used to detect the mouse clicking. This document shows how to use an event structure to detect a mouse double click event. However, this method does not work when you want to run different code if the user single clicks or double clicks because a single click event is fired before the double click event, so both the single click and double click events run.

To distinguish between a single click and a double click you can count the number of click events.

  1. Every time the mouse click event is fired set a timeout counter and increment the click count.
  2. When the timeout occurs, read the value of the counter.
  3. Execute the desired code for the number of clicks using a case structure.

The attached vi shows both techniques for detecting double click events.



Related Links:
KnowledgeBase 417F1DMY: How Do I Register a Double-Click Event on  a Control or Indicator in LabVIEW

Attachments:

DoubleClickvsSingleClick.vi




Report Date: 12/10/2008
Last Updated: 02/20/2014
Document ID: 4S9FAM7G

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit