To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example illustrates how to use a keyboard input to trigger an event in an Event Structure to move a control on the front panel of the VI while the VI is running.
Description
This example utilizes event structures to catch keyboard events. When a particular keyboard event occurs, we read from the Position property node of a front panel control, and based on the key that was pressed, edit Position and write out the new position to the property node. Notice in the VI snippet below, if the "Down" key is pressed, we add 1 to the "Top" value in the control's Position property. This moves the control down by one pixel. This example uses the Up, Down, Left, and Right arrow keys to move the control, but this can be modified to use whatever keys you desire. Also, you can modify this example to move in larger jumps if that is desired.
Steps to Implement or Execute Code
Requirements
Software
LabVIEW 2012 or later
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange. *
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.