Scanner and Keypad input detection on a Input Text Field

Hi Friends

I would like ask you for help. How to detect scanner input and manual Keyboard in the application.

Right now we are using a Text Filed, but we want to ensure the use of scanner, and erase all the text if the text field detect a keyboard input (which means the person are using the keyboard and not the scanner)

Thanks for your time

Best Regards

There are some unknowns here, so without knowing anything else… I have a scanning station client I created that keeps focus on the text field by using the focusLost extension function in scripting. If you click anywhere else, the component will bring focus back to the field so no scans are missed.

event.source.requestFocusInWindow()

I programmed my scanner with a carriage return, so when I scan it executes the code then it resets the text field to blank using

	def reset():
		event.source.text = ''

	system.util.invokeLater(reset)

This way the field is always blank and ready for input whether scanned or typed, just make sure to hit enter with manual input

Hi thanks for your time

The issue that we have is to avoid to insert the text, into the Text Field. with a keyboard, we want to insert the text only with a scanner. How you can avoid that with your scanning station client

Well that seems a little tricky seeing as most barcode scanners emulate a keyboard, therefore it is virtually using the keyboard to enter the scanned data. Disabling any kind of keyboard input, which defeats the purpose of a text input component lol, would disable the scanner too I believe. you might want to look into the barcode scanning module from Sepasoft, it would probably fit your needs best. It is $500. There may be a work around, I tried to set the visibility to zero on the text field but it didn’t pick up any scans that way. I also tried using the keyTyped extension function to reset the text but it didn’t work. Not sure on this one…

I know that seems a little tricky seeing as most barcode scanners emulate a keyboard. but maybe we could play with the time of the scanner process, Because the scanner has de possibility to write faster than a person on the keyboard. but let me check your option and thanks for your advice. see you soon friend