Jump to content

Conflict between enter key and multi-line string


Recommended Posts

Hello,

I have dialog with a multi-line string control, and a button allows to validate the dialog. This button is linked to the enter key.

But this way, the user cannot put multiple lines, because if he hits "enter", the button is fired and the dialog closes! :headbang:

Is there a way to bypass this? like deactivate the "enter" shortcut while the user enters text in the control? I tried but didn't find how.

Thanks for your help! :)

Link to comment

Hi Charles:

Are you using the Prompt user for input express vi?

If so, open it up, (right click>Open front Panel)

right click on the OK button>Properties>Key Navigation tab>

Under the "toggle" pulldown, it probably says "Return" select "none"

Work your way back, save the express vi (You'll be converting it to a regular vi, need to give it a name.-- See the documentation for Express Vi's for details if you need them.)

Should solve your problem (if I understand what the problem is :P ).

Best Regards, Louis

Link to comment
Is there a way to bypass this? like deactivate the "enter" shortcut while the user enters text in the control?

Since you only want the enter key navigation disabled while the user is typing in the string control, use an event structe to detect when the use is typing in the control (key focus), and then set the key navigation of the button to nothing. Then, when the string control looses key focus (another event in your event structure), set the key navigation of the Boolean back to its original state.

Link to comment
Since you only want the enter key navigation disabled while the user is typing in the string control, use an event structe to detect when the use is typing in the control (key focus), and then set the key navigation of the button to nothing. Then, when the string control looses key focus (another event in your event structure), set the key navigation of the Boolean back to its original state.

or disable End text entry with Enter key in front panel options page.

Manfred

Link to comment
Since you only want the enter key navigation disabled while the user is typing in the string control, use an event structe to detect when the use is typing in the control (key focus), and then set the key navigation of the button to nothing. Then, when the string control looses key focus (another event in your event structure), set the key navigation of the Boolean back to its original state.

Thanks :thumbup: , that's what I wanted to do, but I couldn't find out how to change the key navigation of a button at runtime... Now I found :)

However I don't find the event that tells me that the control has lost the focus?

Thank for your help

Hi Charles:

Are you using the Prompt user for input express vi?

If so, open it up, (right click>Open front Panel)

right click on the OK button>Properties>Key Navigation tab>

Under the "toggle" pulldown, it probably says "Return" select "none"

Work your way back, save the express vi (You'll be converting it to a regular vi, need to give it a name.-- See the documentation for Express Vi's for details if you need them.)

Should solve your problem (if I understand what the problem is :P ).

Best Regards, Louis

Hi Louis,

This is not ideal for me, because I still want to fire the OK button when the user hits the enter key while not having the focus in the control :)

Thank you anyway :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.