04-25-2007 12:37 PM
04-25-2007 03:13 PM
Hi Greg,
Did you see Ton's Dynamic event registration Nugget ?
I think that shutting down the event while in the dialog will help.
Regarding "Any ideas why the ESC action .... "
I can only guess.
Ben
04-25-2007 03:33 PM - edited 04-25-2007 03:33 PM
I just set up a simple VI to recreate the problem you're having, and I see the same behavior. I got around it by using the 'cancelled' output of the file dialog prompt. Wire this to a shift register and then read it in the 'Key Up' case. Invert it and AND it with 'if scancode == 1'. This way you'll be checking if the scancode is one AND the dialog wasn't cancelled. If this is the case, signal your cancel button.
Make sense?
Edit: I just realized this will disregard the first ESC press if you cancel the dialog by clicking the button, so it isn't complete. It might help get you started though.
Message Edited by Marc A on 04-25-2007 04:36 PM
04-25-2007 03:34 PM
04-26-2007 03:14 PM
04-27-2007 04:00 AM
Hi Greg,
Good to see that your problem had got solved by changing the event from Key Up to Key Down.
See the below post in configuring the Key Down event.
http://forums.ni.com/ni/board/message?board.id=170&message.id=243437#M243437
I think if a control has got configured with both Value Change & Key Down events, only the Value Change gets triggered always.
See the attached VI. Toggle the Bool constant in the Timeout case & see the rewults.
If it needs to work, either it needs to have got its KeyFocus set to True or the Key Down event should be configured for the Vi itself, & not that particular control.