LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Key for focus in subpanel

Hello,

I have an application consisting of a main VI with a Subpanel in which different other VIs are opened. One of these VIs is a Login-screen. In this Login VI the Enter-key is connected with the button Login, so that the user does not have to use the mouse to press the button.
Now this does not work in the subpanel. Is there a way the the key focus also works in the subpanel?

Best regards
Dermot
Message 1 of 17
(4,917 Views)
Dermot,

This is a known limitation since LabVIEW 7.0 (see comments from Greg McKaskle, one of the LabVIEW developers, here). They're presumably working on correcting this in a future release.

Check out the workaround suggested in that thread, or see another example of a workaround in this one. The general idea is to put the hot control on the main panel, catch the key there, and respond by programmatically toggling the appropriate control in the subpanel to get the desired behavior.

Of course, I'm tempted to suggest that you unbind the key altogether and just train your users to hit the key to get over to the OK button, and then press . That will still work in a subpanel, since it's default boolean functionality that doesn't rely on special key navigation.

There is another potential workaround involving event structures and filtering the key and then triggering the OK button when the user is in a string control, but I did a little test and found that you can't programmatically distinguish between and in this scenario, so I gave up.

Hope one of these ideas helps,
John
0 Kudos
Message 2 of 17
(4,906 Views)
[reposting because my efforts to embed less-than and greater-than characters failed miserably for some reason]

This is a known limitation since LabVIEW 7.0 (see comments from Greg McKaskle, one of the LabVIEW developers, here). They're presumably working on correcting this in a future release.

Check out the workaround suggested in that thread, or see another example of a workaround in this one. The general idea is to put the hot control on the main panel, catch the keypress there, and respond by programmatically toggling the appropriate control in the subpanel to get the desired behavior.

Of course, I'm tempted to suggest that you unbind the Enter key altogether and just train your users to hit the Tab key to get over to the OK button, and then press Enter. That will still work in a subpanel, since it's default boolean functionality that doesn't rely on special key navigation.

There is another potential workaround involving event structures and filtering the Enter key and then triggering the OK button when the user is in a string control, but I did a little test and found that you can't programmatically distinguish between Enter and Shift in this scenario, so I gave up.

Hope one of these ideas helps,
John
0 Kudos
Message 3 of 17
(4,898 Views)
Hi John,

Thank you for the hints. With these I should be able to fix my problem.

Greetings
Dermot
0 Kudos
Message 4 of 17
(4,871 Views)

hello johnner

 

do you know if this bug is fixed . i have same issue unable to solve.

Plz help

thanks

0 Kudos
Message 5 of 17
(3,966 Views)
I doubt that this would -- or even should -- be considered a bug. Key navigation only works on panel that are open and the front panel of a VI in a subpanel is by definition not open.

If you really need this functionality, there are generalized ways of handling it just like there are generalized ways of doing things like letting a VI in a subpanel access menus and buttons on the main screen.

What is it exactly that you are trying to do?

Mike.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 17
(3,951 Views)

If an application changes the subpanel, one might want to access one or more string controls via tabbing through the subpanel without using a mouse. But this seems to be only possible after clicking into one of the string controls (so a mouse has to be used) - After clicking into the string control by making use of the mouse, then its possible to tab to the next string controls in the subpanel by pressing the tab button. Is it possible to set the key focus on a certain string control in a subpanel programmatically?

0 Kudos
Message 7 of 17
(3,176 Views)

Hi Andreas,

 

have you tried to set the KeyFocus property of a string control in your subpanel?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 17
(3,171 Views)

yes, of course, but this does not help ...

0 Kudos
Message 9 of 17
(3,166 Views)

Do VI key events work in subpanel?

0 Kudos
Message 10 of 17
(3,157 Views)