Auto focus input field

When displaying a window containing user input fields, the focus should automatically be set on an input field so that any entered value goes directly into the selected field without requiring a mouse click.

This is intended for use with a barcode scanner. The operator will press a button, which opens a popup window with an input field. This field should automatically be focused so that the operator can simply scan without having to activate the input field with the mouse.

Any ideas?

  • Hi Thomas , we have done this for other customers , we at SolutionsPT can provide you with a solution if you need 

  • Hi Thomas, This can sometimes be a challenge, We have achieved this by using the .Net Winforms Textbox witch has an .Focus() property that can be set using scripting.


    There are some additional challenges if you are using OMI (.Net Winforms is not supported in Industrial Graphics, but in a pane only), but at least its a possible way forward.

    Are you using InTouch for System Platform or InTouch OMI?

  • Some update to my comment, in later versions the possibility to use .Net components in a pane has been changed for OMI, so for OMI solution I might explore the use of a WPF or WebWidget component to use a textbox with focus event, I will have to check what's what and let you know if I find some additional information.

  • This proved to be a real challenge in OMI, I was exploring to use a WebWidget, but it was not possible to set the focus from an external script and have it focus on the widget, and then the text-input. perhaps im missing something in the widget world but I would believe it will not work as easy as I was initially hoping.

    And .Net Textbox is as stated not an recommended option when using OMI.

    But then I started to think on some legacy InTouch trick that could be applicable Slight smile

    You state that you are using a scanner, in my experience, you can configure your barcode scanner to send termination characters, before and after the actual barcode.

    Could you try this;?

    In your popup, place a TextBox Element, 

    On that TextBox, configure your reference and also a "shortcut key" linked to Return.

    My idea is that when the popup is displayed, the scanner sends, <Return> <value> <Return>

    Thus activating the input, enter and committing the value.

    (or any other suitable key character that the scanner could send to activate the input before the actual string)

    Let me know if it works for you!