flutter_barcode_listener icon indicating copy to clipboard operation
flutter_barcode_listener copied to clipboard

Issue with Keyence reading

Open selmaskopljakovic opened this issue 2 years ago • 5 comments

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!

selmaskopljakovic avatar Jun 24 '22 09:06 selmaskopljakovic

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.

Bisc0tt1 avatar Jun 28 '22 12:06 Bisc0tt1

Hello, This was my solution hope it works for you

BIG-BEARC avatar Jun 30 '22 06:06 BIG-BEARC

Solultion from @Bisc0tt1 is the right one. Check how you can configure scanner to emit linefeed end as it is industry standard.

shaxxx avatar Jun 30 '22 07:06 shaxxx

Thank you guys so much! I will try it and come back with a feedback

selmaskopljakovic avatar Jun 30 '22 07:06 selmaskopljakovic

Hello, ok, this is how I solved the reading barcode with Keyence:

  1. Settings of the device - Turn on Keystroke
  2. Settings of the device - Set terminator to Enter Key
  3. 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.

selmaskopljakovic avatar Jul 05 '22 08:07 selmaskopljakovic

Closed as solved.

shaxxx avatar Nov 11 '22 07:11 shaxxx