Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Toggle Key Binding Property Node for Boolean Controls Using LabVIEW

Overview

This example shows how to bind a "shortcut key" to a control

 

Description

This example shows how to bind a "shortcut key" to a control. By using the Toggle Key Binding control, you can change the shortcut key that controls "Light" to any of the possible values that are listed on the front panel with any combination of the Shift and Control key.

 

Requirements:

  • LabVIEW 2012( (or compatible)

Steps to Implement or Execute Code

  1. Run the vi.
  2. Change the Toggle key binding value, to toggle light.

 

NOTE:You can change the shortcut key that controls "Light" to any of the possible values with any combination of the Shift and Control key. 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Comments
Member NI-hilator
Member

I like this approach. It is a little cleaner than using the Keydown event. However, this doesn't seem to work if the Light control is hidden.  I would have liked to use this technique to detect a Contol F# key combination to enable/disable another control but didn't want to have an LED control on the front panel confusing the operator. That said, yes, I know that I can hide the LED control under another front panel control.  I just thought people should know that caveat.

Member El_Penguino
Member

Can you place the LED indicator off to the side so it is not in the viewable area?

Member NI-hilator
Member

Yes, I this could be done.  You would then have to turn off screen resizing and turn off the scroll bars.  Would be easier to place the control in back of another control. Using the Key Down event was actually fairly trivial since I already had an event structure for other purposes.  This is what I ended up doing. I used a constant because there is nothing to hide on the front panel.

NI KeyComboEventCapture.png