LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to collect user input without having to select input box?

Solved!
Go to solution

Hello,

 

I have a control that pops up asking for user input. My only issue with it is when the subvi it is in pops up, the user has to then select the input box to scan their value into it. I have the subvi set up so that once the value changes on that box, the subvi will continue executing.

 

Is there a way to make it so when the user input vi pops up that the input box is already selected and all they have to do is scan? I was hoping to have this popup not need any clicks to use...

0 Kudos
Message 1 of 3
(535 Views)
Solution
Accepted by LearningLabVIEW

Create a property node for your control, select KeyFocus and wire a true constant to it.

KeyFocus.PNG

Message 2 of 3
(523 Views)

@LearningLabVIEW wrote:

I have the subvi set up so that once the value changes on that box, the subvi will continue executing...


You already got the correct answer but I am confused by this statement. Will it continue executing or return control to the caller?

 

Typically such popups have an input field, e.g. string or numeric control, an OK, and a Cancel button. If this is a modal dialog, one would typically set key focus to the input control and assign key navigation to the OK and Cancel buttons as [enter] and [esc]. For text inputs, also set it to "limit to single line" so the entry can be terminated by the enter key (instead of adding a new line to the input!). If the user is also allowed to close the window by the [X] in the upper right, that should be handled using a panel close event and act like pressing the cancel button.

Every popup needs to have a way to cancel it safely and not paint the user into a corner by requiring an answer he might not have at the time. One of the outputs should return a status (e.g. Canceled?=TRUE or error #43) if the dialog has been canceled so the caller will know and act accordingly.

 

Done correctly, the mouse (or tab key) is never needed when handling this kind of popup by the user.

0 Kudos
Message 3 of 3
(497 Views)