Hi guys, I'm facing a problem with my Compose multiplatform project. When I try to read barcodes with my Zebra ET45 internal scanner, the focus loses completely, and I can't write anything else. Can anyone help me with this?
not kotlin but kotlin colored 2
f
François
10/25/2024, 8:44 AM
I don’t think it’s a kotlin issue
d
darkmoon_uk
10/26/2024, 11:13 PM
Usually barcode readers can operate in either HID mode (for compatibility with all Apps) or via dedicated channel (best user experience).
In HID mode they're emulating a keyboard, which is probably interacting badly with Compose in this case. Likely the configuration is emitting tabs, newlines or other control codes along with the barcode digits themselves, and that's causing a focus change. See if you can initialise the reader in a different mode.
On handheld wireless scanners this usually means connecting Bluetooth in RFCOMM Bluetooth profile (emulating a Serial port), but for an internal Zebra scanner I'd expect some SDK function.
Overall I agree with @François this is almost certainly a Zebra Scanner issue and not a Kotlin one.
See: Zebra Scanner SDK for Android
e
Esteban Vasquez
10/27/2024, 2:29 AM
Thanks guys I resolved the problem already
🙌 1
d
darkmoon_uk
10/27/2024, 2:39 AM
@Esteban Vasquez Anything worth sharing? I may be deploying CMP on Zebra Devices soon too.
e
Esteban Vasquez
10/27/2024, 2:34 PM
Nothing special, I just created a new project and I compared both since the second one worked without any issues, so the solution just was upgrading my gradle plugin to the actual version. I'm not an expert so I don't know why it works now!