Cannot set focus/cursor in Text Field on window open

I’m building an application in Ignition that requires operators to scan their badge bar codes in to confirm ID. The issue I’m having is that in order to prevent an operator from typing in a code, as opposed to scanning one, I need to make the Text field designated for the badge scan entry to be invisible. So, in order for the scans to take place, focus and cursor must be set to this field when the popup opens, otherwise they will not find it.

I have tried many various methods found online, and none of them appear to work. Some give the field focus, however, it still will not take data from keyboard/Scanner without first being clicked on. Cannot believe this can be this difficult. Has anyone dealt with this, and if so, how did you get around it?

The solid solutions I’ve seen have all used non-keyboard connections (usually serial) monitored at the client level, not as a field data entry.

This is not very encouraging. I am developing a similar app where operator scans their badge to log in.
We don’t care if they can see the field or not.

Can’t say as i understand this “have all used non-keyboard connections (usually serial) monitored at the client level, not as a field data entry”. What does that mean?
It seems like the Text Field that has focus on screen open should take a barcode scan.
I don’t have the hardware to test yet, and I thought it was going to be easy, but your answer makes it sound not easy. Am I missing something?
Also, visually how can you tell if a field has focus or not?

1 Like

Have you tried using .requestFocusInWindow() for your application?

1 Like

Not sure if you solved his problem but you solved mine. thanks for this!

2 Likes