Barcode scan event not being detected

I have a barcode scanner which can populate a text field when in focus however, instead of populating a text field, I would rather the scan trigger an event i.e., write to a tag. This scan event works as expected when using the perspective application on my mobile device but I need it to work with a USB scanner device. Does anyone know why it works on one device and not the other?

Because native barcode scanner functionality in the mobile app bypasses the keyboard, using mobile OS features. A USB scanner typically behaves just as a keyboard. (Some can be made to emulate a serial device instead, but Perspective has no way to handle that.)

1 Like

So there’s no way to detect an event when using a USB scanner?

Just keystrokes.

Okay Thanks. Instead of detecting a scan event, is there a way (in perspective) to set the focus of a TextField component? If it helps, this would be the only Inut/TextField in the view.

Yup:

https://forum.inductiveautomation.com/search?q=perspective%20textfield%20set%20focus

Thank you. Do you know if functionality for detecting scan events using a USB will be added in the future or will the scanning always have to be done using the mobile application?

I would expect supporting USB scanners in serial mode to be difficult but not impossible. Maybe only in Perspective Workstation, not Mobile. (Not at all in a browser.)

{ This is one of the things Vision Clients can do for which there’s no path to Perspective. }

Thanks again.

Instead of detecting a scan, I am now setting the focus of a TextField and then adding a text property change script on the TextField which will then write to a tag. Having an event trigger on a scan would simplify this process a lot.