Moving Between Controls in a Cluster With an Enter Key in LabVIEW

Updated May 21, 2024

Environment

Software

  • LabVIEW

To facilitate the movement between controls in a cluster, the utilization of the <Tab> key is typically required. However, if there is a desire to accomplish the same process using a different key, such as the <Enter> key, the following example steps can be followed to enable this functionality. 

There is a need to use the Key Focus Binding property node within the Event structure. Use the following steps below. 

1. Create an event state for every control you want to move between, for each control’s event state choose 2 events.
  1. Key Down? (Detects the key the user presses)
  2. Key Repeat? (Generated at regular intervals when the user presses and holds a key in a front panel control)

2. Add the Key Focus Binding property node.
To add a property node, right-click on the control from the Front panel and choose Create > Property Node > Focus Key Binding (do the same with all the rest of the controls).  

image.png

3. Modify the code.
  1. Add a Focus Key Bind property node in every event state by setting the following control's property node in the current control's Event state, (for instance in the Control1's Event state there needs to be set Control2's property node) This is done to change the focus key to the following control.
  2. Create a constant input cluster for the property node. 
  3. Set the Key value of the cluster as <Enter>.
A picture containing text, font, screenshot, line  Description automatically generated

After completing the steps, you can write something in one of the controls or just press Enter and the key focus will be changed to the next control. Try following the steps carefully to avoid any issues.