07-12-2020 01:24 PM
Guess what. You also have two shift keys, two control keys, and two alt keys. They are two different keys as seen by the vkey code, but actually are the same key as they do the same function.
On my keyboard both the key on the alphanumeric part and the key on the number pad both say "Enter". They do the same thing. They do have two different vkey codes.
Early computer keyboards, the key on the typing area was called "Return". That was derived from the "carriage return" function of electric typewriters. At that time "enter" would not have made any sense since there was nothing to "enter" into a typewrite. That key was called "return" and was needed to give the functionality that a typewriter needed to "return the carriage" back to the beginning of the line which was what the big bar did on manual typewriters.
I think early computer keyboards said "return", but over the years as typewriters have become a distant memory, keyboard manufacturers have just started printing "enter" on that key.
07-13-2020 10:02 AM
RavensFan I agree with all that, except that Enter and Return DO act differently when inputting text.
willcan, I literally just realized something. You could have just left it as an Express VI and the way not to have to click the OK button would be to press Tab then Enter/Return.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
07-13-2020 10:05 AM
@FireFist-Redhawk wrote:
RavensFan I agree with all that, except that Enter and Return DO act differently when inputting text.
willcan, I literally just realized something. You could have just left it as an Express VI and the way not to have to click the OK button would be to press Tab then Enter/Return.
I have never seen them act differently. And what precisely do you mean by "inputting text"? What application are you working with.
Tell me how they do.
07-13-2020 10:15 AM - edited 07-13-2020 10:20 AM
Make a free label, subdiagram label, string control/constant, anything like that, and start inputting text (typing in stuff). Press Return and it will put you one line down, press Enter and it will "finish" or "submit" the text, the text cursor will go away, and you won't be able to add more text unless you click it again.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
07-13-2020 02:29 PM
Interesting. I've never noticed that before.
1. I've never seen another program distinguish between the two.
2. If I am doing labels in LabVIEW, I'm typing text and will hit the enter key on the typewriter area rarely and only if I need to do a multi-line comment. Then I'd click off and do something else when done. I would never hit the enter key in the number pad area when doing comments.
The only time I use the enter key in the numpad area is when I'm entering values into cells in Excel.
07-13-2020 03:05 PM - edited 07-13-2020 03:12 PM
On basically every other program I've used, they do function the same, and the way to get that different behavior is with a modifier+Return/Enter.
1. Entering text in an Excel cell? Alt+Return/Enter gets you down a line. Ctrl+R/E and Shift+R/E act the same as just R/E.
2. Typing a comment or message on Facebook? Ctrl+R/E or Alt+R/E or Shift+R/E.
3. Sending a message in Skype? Shift+R/E. Ctrl+R/E will actually call them, oddly enough. And Alt+R/E does absolutely nothing!
4. And back to LabVIEW, Ctrl+Return = Enter.
We're digressing hard on this gentleman's post, but yeah I've just been testing on different programs to figure out most of what I just mentioned. Very interesting indeed.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
07-16-2020 03:46 AM
Hi redhawk ,
one more query !
If operator enter a string characters which includes the special character means . I need to block or give a alert to him as " don't enter special characters it was invalid" like that .
so how to block or check the string input which includes the special characters .
using search string, i need to enter all special characters ? or some other method ?
07-16-2020 04:20 AM - edited 07-16-2020 04:26 AM
Hi willcan,
@willcan wrote:
one more query !
If operator enter a string characters which includes the special character means . I need to block or give a alert to him as " don't enter special characters it was invalid" like that .
so how to block or check the string input which includes the special characters .
Use an event structure to capture keypress filter events of that string control: now you can disable any char/key you like very easily…
On that Return/Enter difference in LabVIEW:
There are some places where LabVIEW takes advantage (IMHO) of using both keys.
07-16-2020 11:15 AM
@willcan wrote:
If operator enter a string characters which includes the special character means . I need to block or give a alert to him as " don't enter special characters it was invalid" like that .
No, don't alert the user, just make sure that only valid characters can be entered.
Typically you would use a filtering "key down?" event and discard the input.
Here is a very old example that only allows up to 8 printable characters. It can easily be adapted for your purpose.
07-16-2020 01:26 PM
Hi willcan,
To add onto what GerdW and altenbach said, yes you basically want a Key Down? event for your string that you want filtered, and filter out what you consider special characters base on their ASCII codes, like this:
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.