Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android scanning code128 barcode decodes to something different #34

Open
Florianvdab opened this issue Jan 19, 2023 · 6 comments
Open

Comments

@Florianvdab
Copy link

Hi guys, I'm liking the package so far but I'm struggling with something. While using a CS6080 scanner as an HID keyboard via BT, I'm scanning a CODE128 barcode:
image
The barcode should decode to: 3BE9604F-9E76-42F8-A584-288AD1B7D087

When I scan this barcode on a notes app on both android and iOS it scans the whole barcode correct, so the scanner is working as expected. But on my flutter android app it decodes to: #Be960$f-(e76-4@f8_a584-28*Ad!b&d087
I've tried debugging the package a little and it looks like it might be because of a shift key or something like that.
On iOS however it seems to be working perfectly.

Can you guys possibly help me out? Feel free to reach out so I can help further.

@anthonycuervo23
Copy link

I am having the same issue, did you find a solution ?

@Florianvdab
Copy link
Author

No, the problem seemed to be in the way keys are pressed on the different OS. From what I can remember shift keys were the problem. I didn't have the time to figure out a solution for this issue, I guess the best thing you can do is make sure barcodes are simple...

@anthonycuervo23
Copy link

No, the problem seemed to be in the way keys are pressed on the different OS. From what I can remember shift keys were the problem. I didn't have the time to figure out a solution for this issue, I guess the best thing you can do is make sure barcodes are simple...

With shift keys you mean to avoid sending any symbols like -{,:"}@ ?

@Florianvdab
Copy link
Author

No, my scanner was acting like a keyboard. A capital letter a would be Shift + a . That would give me issue, you can always log or debug the package to learn what exactly happens to the barcode that you scan.

@m-pastuszek
Copy link

m-pastuszek commented Sep 11, 2023

I have same issue. Outside the app, the barcode is recognized correctly. Just using this package I get incorrect decodings.
For example, barcode 4000_TRA_TRAILER01 decodes as 400)_TRA_TRAILEr01. Any ideas?

Okay, It looks like shift issue... But is there a way to solve this without changing barcode data?

@MongkolJ
Copy link

I have had the same problem. Enable flag useKeyDownEvent did work for me.

BarcodeKeyboardListener(
    useKeyDownEvent: true,
    bufferDuration: const Duration(milliseconds: 2500),
    onBarcodeScanned: (barcode) async {},
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants