Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Dec 2023 12:18:27 +0100
From:      Milan Obuch <freebsd-usb@dino.sk>
To:        freebsd-usb@freebsd.org
Subject:   USB bar code reader 'detached' usage?
Message-ID:  <20231214121827.6133f219@zeta.dino.sk>

next in thread | raw e-mail | index | archive | help
Hi,

I am working on a project using bar code reader. When plugged into USB
port, it is recognised as USB keyboard, as illustrated by following
snipped from console log:

ugen0.8: <OKE Electron Company OKE PS2-USB V1.61> at usbus0
ukbd1 on uhub8
ukbd1: <OKE Electron Company OKE PS2-USB V1.61, class 0/0, rev 1.10/0.01, a=
ddr 8> on usbus0=20
kbd3 at ukbd1

When I scan some barcode with it, raw keyboard codes are sent into
system keyboard. It just works as usual USB keyboard. This has some
problems.

First an annoyance - slovak keyboard layout traditionally shifts
numbers to uppercase. So with this layout, instead of numbers 123 I an
getting +=C4=BE=C5=A1 - while it works as intended, the result is not right.

This is not a big problem for my project, it does not use system
keyboard in its intended setup, communication is done via touch screen,
so I can just switch keyboard layout to English, but it is a hack I'd
like to avoid.

I'd like detach bar code reader from system keyboard (kbdmux), and
somehow read the complete bar code when detected, maybe as some kind of
event delivered to my program.

Did anybody encounter similar situation? Anybody working with USB bar
code readers who can share some experiences?

Regards,
Milan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20231214121827.6133f219>