LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keep Focus between subpanel & Main without using Mouse

Hi Kousy,

I'm curious to know if U re an Indian. I ve a cousin bro'r by name Koushik, we call him Kousy only... !

I'm very happy that I could help for Ur requirement exactly. Smiley Very Happy

See n analyze the scan code for various keys, if U re inclined to using the ASCII values only.

Bye for now.

- Partha ( CLD until Oct 2027 🙂 )
Message 11 of 17
(1,215 Views)

Hi,

I moved the code for each buttons (associated with F2 thru F10 hot keys) into keydown event of Main vi.
Without use of mouse this is fine. But when I try using mouse click on the button, its not working becos I moved the Value change event code of each buttons(F2-F10) to keydown event. How should I overcome this? In some places I want to use both mouse & keyboard.
 
 
Regards,
Kousy
0 Kudos
Message 12 of 17
(1,198 Views)

Hi Kousy,

Answer lies inside Ur question itself... ! Smiley Wink

Use Mouse Down, NOT Mouse Down?, to do the function U want when a button is pressed. Thats it.

If U had associated a short-cut key for a button thro' its Key Navigation, U may also ve tp put the same code for its Key Down event too...

What I ve done in the given example was Key Down event of the VI itself.

What U may ve to do will be Mouse Down & Kwy Down events of the Button(s) U may wish to click(or its short-cut key to press).

Keep these things in mind when U design Ur application.

See the attched pics for more details on the various events.

- Partha ( CLD until Oct 2027 🙂 )
Message 13 of 17
(1,192 Views)

Attachments for Key Navigation.

It allowed only 3 attachments... ! Smiley Indifferent

- Partha ( CLD until Oct 2027 🙂 )
Message 14 of 17
(1,192 Views)
Hi partha,
 
Yeah, I am Indian.
 
From your reply I understand one more one thing.
 
I have to replicate the codes in Mouse Down Event of the Control + Keydown Event of the VI where the button is placed.
Moreover the same code has to replicated once more in the Keydown Event of the control if I am maneuvring thru tabs, reaching that button and press Enter too. Am I right?
 
In text based language, I dont have to repeat the procedure again and again, but simply I can call the routine by the name of the Event. That way, I thought there should be simpler solution to do this, instead of copying the code and putting under too many events (avoiding mouse using keyboard needs more memory!). May be I am wrong. This is what I understood. Correct me If I misunderstood.
 
 
Regards,
Kousy
0 Kudos
Message 15 of 17
(1,187 Views)
Kousy,

You can create subVIs to simplify the replicating of code. Either put a copy of the subVI in each event case or put one copy outside in a parallel loop and send commands to it from the event cases via notifiers or queues. If the code requires more than 10s of milliseconds to run, the parallel loop approach is probably better from a front panel responsiveness perspective.

Lynn
0 Kudos
Message 16 of 17
(1,183 Views)

Since I ve not used Queues or Notifiers much, I ll go exactly with Lynn's methodology of creating sub-VIs.

That ll serve the purpose for U.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 17 of 17
(1,168 Views)