LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How detect key ENTER in Event Structure

I have developped a check password VI, with a text box and boutons OK and Cancel. It's easy to program the event structure when the user click on the OK bouton, but I don't know how to do the same thing when the user press the Enter key to validates his login.
I think I should use the filter event on the ENTER key but how ??

thanks.

Eddy
Eddy DUCHENE
12 F Chemin de Boutary
69300 CALUIRE ET CUIRE

educhene@laposte.net
0 Kudos
Message 1 of 5
(6,248 Views)
I think there are three ways to do this.

1) Detect the Key Down event of the VI and check whether it is ENTER according to the value of VKey.
2) Add a button in your front panel (you can hide it), and set the Key Navigation of the button as ENTER. When you hit ENTER, the button is TRUE.
3) Detect the Value Changed event of the string control where you type password. See the attached VI.

Good luck
0 Kudos
Message 2 of 5
(6,248 Views)
Argh !!

I understand your solutions => so I can't use the event notification filter (on the right of the event structure) to detect this; OK.

I have a little pb : I'm using LV7.0 and your example is written with LV7.1 => I can't open it...
Could you save it in LV7.0 ?

Thanks.
Eddy DUCHENE
12 F Chemin de Boutary
69300 CALUIRE ET CUIRE

educhene@laposte.net
0 Kudos
Message 3 of 5
(6,248 Views)
It is possible to detect a Key Down event on a button with the event
structure, but only if the button has key focus.

The better way is to setup Key Navigation on your buttons so that the
key is associated with 'OK' and is associated with
'Cancel'. To do it, right click the buttons, choose Advanced >> Key
Navigation...

After setting up the key navigation, you can use the Value Changed
events on your buttons.

Good Luck,
Scott
0 Kudos
Message 4 of 5
(6,248 Views)
Here is the example in LV7.0.
0 Kudos
Message 5 of 5
(6,248 Views)