flutter_barcode_listener
flutter_barcode_listener copied to clipboard
Issue with Keyence reading
Hello,
I tried to use this package for the Keyence device. My app runs at Keyence, but I can't detect scan triggers to use data with your example. Your idea is exactly what I need, scanning without focusing on TextBox and without a mobile keyboard, just to listen to triggers from the device. Do you have any idea why this is not working? Thank you!
Hi,
I ran into a similar issue. Keep in mind the callback onBarCodeScanned
that gives your frontend actual data to work with won't be executed if the library thinks the final character entered wasn't an enter/linefeed. Most scanners will end the scanned payload that way, but not all of them. I myself was testing this on a Unitech PA760 and had to configure the device to terminate a scan with <LF> (linefeed) instead.
I would suggest to start by debugging the library itself, specifically the function onKeyEvent()
. Confirm the characters are being registered when you scan by printing them to the debug console, then check if the if statement if (char == lineFeed)
is actually entered. If not, it's almost certainly because your scanner isn't terminating its payload correctly.
Hello, This was my solution hope it works for you
Solultion from @Bisc0tt1 is the right one. Check how you can configure scanner to emit linefeed end as it is industry standard.
Thank you guys so much! I will try it and come back with a feedback
Hello, ok, this is how I solved the reading barcode with Keyence:
- Settings of the device - Turn on Keystroke
- Settings of the device - Set terminator to Enter Key
- This is how I read data
(keyEvent.data) as RawKeyEventDataAndroid).keyLabel
Have duplication, like 22334455 instead 2345. But That's easy to solve.
The only issue I'm struggling with is turning off the keyboard. I tried all that could be found on google, but still no good solution.
Closed as solved.