LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"enter text" button

Solved!
Go to solution

Hello everyone,

I am having a problem concerning the way the two enter keys on the keyboard act.
The enter on the center of the keyboard acts as a line feed, in other words, finishing a line in a string and starting a new one.
The enter on the numeric keyboard, however, acts pressing the "enter text" button, which appears at the top left corner of LabVIEW when you're using a string.

My question is: is there a way to make the Enter on the numeric keybord act as a line feed?

 

I'm using LV 8.6.

0 Kudos
Message 1 of 6
(4,465 Views)

Actually this is a Hardware issue.

 

When you press a key on the keyboard the keyboard passes a "scan code" to the HMI driver that is specific to the key(s) that are pressed.

 

While both the "Enter" and Numeric "Enter" are labled "Enter" on most modern keyboards the "Enter" on the QWERTY area is actuallt a hold-over from manual typewriters and it's scan code is a "Return"

 

So you have two keys that give your 

\n  or \r  Meaning NewLine or Carrage Return  ASCII maintains both

Message Edited by Jeff Bohrer on 03-05-2010 01:56 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 6
(4,458 Views)

Thank you Jeff,

 

If it is a hardware issue, then I can't do much.

But maybe my problem could be solved if I could disable the "enter text" button. Is it possible?

0 Kudos
Message 3 of 6
(4,434 Views)
You could handle the Key Down? event and if the VKey is <Enter> then you can wire a True to the "Discard" element of the output elements for the event structure. You could even insert an EOL into your string. You'd have to manually move the cursor if you do that, though.
0 Kudos
Message 4 of 6
(4,423 Views)
Solution
Accepted by topic author Erick-EMY

I see you have 8.6, but perhaps this picture (a V9 snippet) will show you one approach (at least for a running VI).  You can use a Key Down? filter event to either discard the Enter key, or replace it with a Return.

 

EnterReturn.png

 

This picture shows how to replace the Enter with Return, you could also wire the output of the comparison to the Discard terminal to disable the Enter Key.  This shows how to do it for an entire VI (while it is running), you could also use the Key Down? event for a string control to limit the effect.

 

Edit:  Added LV8.6 VI

Message Edited by Darin.K on 03-05-2010 12:35 PM
Message 5 of 6
(4,422 Views)

Problem solved!

Thanks, Darin.K

0 Kudos
Message 6 of 6
(4,381 Views)