To download NI software, including the products shown below, visit ni.com/downloads.
This VI toggles the Boolean button when the space bar pressed, unless the user is entering text into the String Control
This VI demonstrates how an event structure can be used to toggle the value of a Boolean button.The Toggle Key Binding property node can also be used to accomplish this, but the property node cannot be used with every key on the keyboard. In this example we want to toggle the Boolean button with the space bar, which cannot be used with the Toggle Key Binding property node.
Because we do not want the Boolean button to toggle when we are typing in the string control, the Key Focus property node is used to determine if the string control has key focus. If it does have focus, we do not toggle the Boolean control.
LabVIEW 2012 or compatible
Steps to Implement or Execute Code
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.