OK, I have a text box to be filled via a barcode scanner. We wish any other numeric keyboard input blocked. We’d prefer no other app code be used outside of Ignition if possible. I can block the keyboard inputs via java.util.EventObject scripting, but then the scanned value (10 digits) is not reliably seen before being rejected just as the individual typed characters would be.
I’m thinking if the scanner input could all come in (be buffered?), then I can bypass the rejection code if the input is 10-characters.
Is something like this possible perhaps using java.io.BufferedReader?
If so, I am unsure how to proceed.
I may well be over complicating it.
The blocking code I speak of is akin to below, on the text field keyPressed event handler
from java.util import EventObject
if event.keyCode== event.VK_NUMPADX or event.VK_X …etc where X is 0,1,2,3 …
# block the input , show screen message
As I said, keyboard input is reliably rejected.
I just need to allow the scanned “string” to be allowed
I have no specifics on the scanner being used other than it will likely be wireless.