LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The "Enter" key is disabled after I select a radio button with a function key.

I have a "dialog box" VI that has an OK button and a group of radio buttons. I've assigned function keys F1 through F5 to the radio buttons. The assigned the "Enter" key to the OK button.

Once I select any of the radio buttons with a function key, the OK button no longer responds to the "Enter" key. At that point, I can't even tab to the OK button. How do I make this work?

Attached is a simplified VI illustrating this.
0 Kudos
Message 1 of 7
(3,605 Views)
Please try again to attach your VI

Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 7
(3,604 Views)
Hopefully it attached this time, I removed a space from its name.

It is also here:

http://www.lctechnology.com/set_time.vi
0 Kudos
Message 3 of 7
(3,592 Views)
I'm sorry to tell you that it appears to work fine on my machine, when I run it (stand alone , not called from another VI) and press any of the function keys the appropriate radio button is selected. If I then press "Enter" the vi stops. I was also able to tab to the OK button after a function key selection ...?


Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 7
(3,592 Views)
Did you have to press the Enter key twice?

Here's more weirdness I'm seeing, under WinXP and Win2k....

After selecting a radio button via function key, the Enter key next to the keyboard's letters does not work at all, but the Enter key next to the keyboard's numeric keypad works on its second key down, not its first.
0 Kudos
Message 5 of 7
(3,586 Views)
I tried it on my system and when I press a function key (like F3), the focus moves away from the OK button to the radio button. If I press Enter, nothing happens. I can tab to the OK button just fine, and then I press Enter and the vi stops as expected. If you right click on the OK button and choose Advanced - Key Navigation, and assign the Enter key to the OK button, read the text in the Tips box. It says: "The key changes the key focus to the control to which it is assigned, UNLESS the key focus is already on a Boolean control. In that case, toggles the focused control...." What this means is that when you press the F key, the focus is now on another boolean control and pressing Enter will do nothing since you can't toggle a radio button (clicking more than once on the same radio button does nothing). So the key assignment works as it is described. You would have to add code to make the OK button have focus when any Fkey is pressed. You could use the event structure to do this. Capture the Fkey value change event, and use a Key Focus property node for the OK button to set the focus. Then you can press Enter to stop the vi. I've tried Key Up event and it didn't work. Something about the OS and Fkeys. But value change works fine. See attached vi.
- tbob

Inventor of the WORM Global
Message 6 of 7
(3,586 Views)
That explanation makes perfect sense, thanks. I should have read the "Tips" box.
0 Kudos
Message 7 of 7
(3,579 Views)