LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to separate "Key down" event from panel and numerical control

Solved!
Go to solution

Hi, All

 

I have a vi proecess key down events for panel and  a numerical control in this panel. the application will do: 

1. when panel is focused, user can use "up" and "down" key to driver some hardware.

2. when the numerical control has the focus, "up" and "down" key will change it's value as usual.

 

somehow the second one did not work, because the panel "key down" event was trigger as well when I use "up' "down" key inise the numerical control. 

 

then I used "Key down?" of numerical control to block the "up/down" key. But the first time when I run the Vi, the panel still got triggered one time. 

 

any suggestions on this? test code attached  in this post too. 

 

thanks


CQ
0 Kudos
Message 1 of 4
(3,294 Views)

Use the application key-down event and combine it with the key-focus-property of the others to decide which function should be used.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(3,278 Views)

you mean the VI keydown event? I registered it as dynamic event in my code. but still did not make it work. any simple example?

 

thanks


CQ
0 Kudos
Message 3 of 4
(3,186 Views)
Solution
Accepted by topic author CQ_Li

This works for me in 2014.  In short, you just need to check to see if your numeric has the focus.  If it doesn't, then you process the key value.  No need for any other event here except for the stop button.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(3,178 Views)