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
Run the VI
Press the space bar, and notice the Boolean button toggles
Enter a string to the string control. Then press the spacebar, and notice that the boolean button isn't toggling
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange. **