From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create control shortcuts in event structure

Solved!
Go to solution

I'm creating an event structure dialog with radio button controls.  Is there a way to create shortcuts to select each radio button, similar to windows underlined letter?  I'm using a string control with keyfocus=true to change the radio button selection, but when the user tabs elsewhere, then focus is lost.  Is there a way to set focus back without polling the string control in the timeout case when focus is lost?

Download All
0 Kudos
Message 1 of 5
(3,165 Views)

How about setting up an event case when the user releases the tab key? In that case, set the focus back to your current "Key Focus" control. You will have track of the control reference of the control you want to keep key focus on. My attached image always keeps the key focus on one of the controls.

0 Kudos
Message 2 of 5
(3,154 Views)

Capture the key-event, check e.g. for alt+1..5, set control.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 5
(3,139 Views)

You need to capture the key event in the <This VI> source to make it universal.

In my example (shown below) I use the Key Down? filter event.  This way the focus can be anywhere and it will still work OK.

 

2013-08-12 12_57_41-Untitled 1 Block Diagram _.png

 

I would highly suggest using Yamaeda's suggestion for adding the Alt modifier which I did not use in my example

 

Edit:

The case which cannot be seen (-1) is blank

0 Kudos
Message 4 of 5
(3,127 Views)
Solution
Accepted by topic author theanalogkid

Because it is universal...capturing the key event seems to be the best choice.  Especially because I didn't want to give up my tabbing function & order.  I also added a second array of ASCII char codes to search and handle upper case shortcuts.  Thanks!

 

event.png

 

0 Kudos
Message 5 of 5
(3,069 Views)