LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hotkey and subpanels

Hotkeys defined on controls in a VI Panel shown in a subpanel in another VI are not working!!! It's the VI containing the subpanel control that receive the hotkeys...
Is there any workaround to avoid this very annoying and unattended behavior?
0 Kudos
Message 1 of 9
(3,904 Views)
Here is a link that may help you.

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000096CA0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=key+focus+in+sub+panel&USEARCHCONTEXT_QUESTION_S=0



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 9
(3,904 Views)
Thanks but nothing really interesting to me. Of course I could do what I need by programming... But I don't want to wire anything for a functionnaility that should be normal and straight! I'm mostly searching for a way to redirect keyboard input from a VI directly to one another...
0 Kudos
Message 3 of 9
(3,904 Views)
ManuTec wrote:

> Thanks but nothing really interesting to me. Of course I could do what
> I need by programming... But I don't want to wire anything for a
> functionnaility that should be normal and straight! I'm mostly
> searching for a way to redirect keyboard input from a VI directly to
> one another...

This just isn't in LabVIEW 7.0 yet. Sub Panels have a lot of uses but
also some limitations at the moment. Passing key shortcuts to the sub
Panel is one of them. Maybe this is fixed in LabVIEW 7.1 but it is not a
simple thing to do, so it may not.

NI decided to make the sub panel available in 7.0 despite of its known
short comings. You can request that they make only features available
that work perfect but then sub panels wouldn't be avai
lable yet.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 9
(3,904 Views)
Hi Rolf, You work for NI Now?
🙂
I mean : I don't need any explanations why this works this way. I need, if exists, a direct and elegant workaround to my problem.
So if you don't have any solution, don't waste your time by giving an "answer" that any commercial guy could give...
Sorry to be dure, but I think that this kind of non answering come back a litle to often...
0 Kudos
Message 5 of 9
(3,904 Views)
> Hi Rolf, You work for NI Now?

I wish. Personally, Rolf says what I'd say 60% of the time, but I don't
have to say it. Thanks Rolf.

> I mean : I don't need any explanations why this works this way. I
> need, if exists, a direct and elegant workaround to my problem.
> So if you don't have any solution, don't waste your time by giving an
> "answer" that any commercial guy could give...
> Sorry to be dure, but I think that this kind of non answering come
> back a litle to often...

The hotkeys don't work, and that is a bug. I tested a version of 7.1
and it wasn't fixed there either, though I'm testing what is on my home
machine which is beta. The key focus properties do work as does
tabbing once you are inside th
e subPanel. In my opinion, the hotkeys
will always be a bit dicey since you can now easily have multiple
destinations for the same key. That isn't why this wasn't finished, but
even when it works, it will always cause trouble with hot keys.

My workaround, though not that elegant would be to scan the Controls[]
looking for ones with Keynav values. Remember who they are and what key
they were assigned, then in the host, you register for keys, decide who
gets them, and set the Key Focus property to True. It will take a bit
of programming to make it general, but then you could use it for lots of
situations.

To do this one-off for a single or small set of subpanels, make
offscreen controls that mirror the hotkey settings and when they get
focus, they kick it to the subpanel versions of themselves. Definitely
not elegant, but quick in a pinch.

Greg McKaskle
0 Kudos
Message 6 of 9
(3,904 Views)
Hi Greg,
Thanks for not triving to find explanations to this lack. You try to give me a work around and that's the purpose of those forums...
Ok, something I miss : Giving keyfocus to a control won't activate this control! Your solution says that when you press a hotkey then focus is given to the subpanel's concerned control, is that right? But this won't activate it, you need to hit enter key then...Or my english is so bad that I didn't understood your idea?
0 Kudos
Message 7 of 9
(3,904 Views)
I wrote a quick VI that does what I described. It doesn't go into clusters or tabs looking for controls, just does the top level on the subPanel. It should get you started. I also left the code at the top level instead of making subVIs. If it gets any more complicated, it should be broken down into some helpers.

The VIs are version 7.0 and of course the subPanel will report an error if the subVi is open when trying to run the main. Good Luck.

Greg McKaskle
Download All
0 Kudos
Message 8 of 9
(3,904 Views)
Greg, Thanks for wiring this example, especially on a saturday, which is also (at leat here) a commemoration day (Something like end of second world war, another good reason to thank American people today...).
But the real drawback of this solution (we tried something similar before) is that it doesn't work with latched actions (on booleans)...
0 Kudos
Message 9 of 9
(3,904 Views)