07-15-2008 04:44 PM
07-15-2008 04:45 PM
07-15-2008 05:24 PM
07-16-2008 08:25 AM
07-16-2008 09:02 AM
07-16-2008 10:18 AM
Sheesh. No wonder it's hard to get things to work.
Here is another try. I think the main calls the correct sub, and it still doesn't work.
Thanks!
07-16-2008 10:21 AM
07-16-2008 10:50 AM
Oh! I didn't realize the distinction. Registering KeyDown for the controls is not what I mean to do, then. I want to register for all KeyDown events that occur when the overall parent VI has focus.
Here's a version with Panel > OwningVI > Key Down selected in the nodes that register events. It seems to do what I want. It acts on keystrokes that occur when the cursor isn't even over the parent's window, which is good in my situation. I made these choices by experimenting - is this a good approach, if I want to act on all the keystrokes that occur when the parent VI has focus?
Thanks! This distinction is important and it didn't occur to me this might be so, and don't think I've seen it anywhere. It's a big help!
07-16-2008 10:52 AM
07-16-2008 11:05 AM
As you noted, this will have the event structure respond to keypresses whenever the parent VI is active. You can simplify the subVI by simply wiring the "VI Refnum" terminal directly to the Register for Events node. Getting the Panel, and then the Owning VI simply gets you back to where you started.
@cebailey wrote:
Here's a version with Panel > OwningVI > Key Down selected in the nodes that register events. It seems to do what I want. It acts on keystrokes that occur when the cursor isn't even over the parent's window, which is good in my situation. I made these choices by experimenting - is this a good approach, if I want to act on all the keystrokes that occur when the parent VI has focus?
Thanks for the compliment. It's just a matter of seeing a lot of code and a lot of questions. I'm only a teenage pup compared to the real veterans on this board.
Say, I should have said this before, but you have to be pretty good to answer the question somebody should be asking, especially in brief forum postings.