08-12-2013 12:17 PM
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?
Solved! Go to Solution.
08-12-2013 12:26 PM
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.
08-12-2013 12:44 PM
Capture the key-event, check e.g. for alt+1..5, set control.
/Y
08-12-2013 01:02 PM - edited 08-12-2013 01:03 PM
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.
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
08-12-2013 07:55 PM
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!