Handle Keyboard Events in Event Structures in LabVIEW

Updated Apr 20, 2026

Environment

Software

  • LabVIEW

Event Structures in LabVIEW can be configured for handling user inputs from the keyboard. This article will lead you through the process of adding a Key Down event to the structure, binding this event to the specific key and configuring events for key-combinations. 

  1. To configure the structure right click on the border of the event structure.
  2. Click Add event case.
  3. Select <This VI>.
  4. Select Key Down.
  5. Click OK.

 

 

  1. To bind the event for a specific key, navigate to the Key Down event on the Block Diagram by clicking on the black arrows at the top border of the structure.
  2. Create a Case Structure.
  3. Wire the Char output to the case selector terminal of the Case Structure.
  4. Configure the Case Structure with the decimal [External] ASCII codes of the key as on the following screenshot:

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

 

  1. To configure key combinations, unbundle the PlatMods cluster output at the event case.
  2. Wire the selected element to the case selector terminal of a Case Structure drawn around the original Case Structure evaluating the character:

 

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
 

After completing these steps, your LabVIEW program will be able to handle the specified user inputs from the keyboard.