JavaScript 中的条形码扫描仪?或者插件/扩展
我正在考虑将 USB 条形码扫描仪接口写入 Web 应用程序(离线应用程序)。我的意思是扫描仪将位于客户端计算机而不是服务器上。所以我想知道最好的设计是什么。
我知道我可以将 ActiveX 对象或本机插件写入某些浏览器,但这并不理想,有谁知道 chrome 扩展(在 javascript 中)或 firefox jetpack 是否支持这种功能。
有什么想法吗?如果有任何线索,我将不胜感激。
谢谢大家
吉多
I'm looking at writing a USB barcode scanner interface to a web application (offline app). By this I mean that the scanner will be on the client machine not server. So I was wondering what the best design would be.
I know I could write an ActiveX object or native plugin into some browser but this is not ideal, does anyone know if chrome extensions (in javascript) or firefox jetpack would support this kind of functionality.
Any ideas? I would appreciate any leads to follow.
Thanks All
Guido
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
USB 条形码扫描仪实现了 HID 设备(无论如何都是正常的),这意味着它们的作用就像普通键盘一样。默认操作模式是“键入”条形码,然后按“Enter”。一些条形码扫描仪具有高度可配置性,通常通过扫描图表中的配置条形码,允许您更改此行为。
唯一的问题是特殊字符 - 这取决于您要扫描的内容。
好消息是不需要编写任何特殊的控件或扩展或插件。您所需要做的就是自动聚焦于输入控件并根据按下的回车键接受表单。
USB barcode scanners implement a HID device (the sane ones anyway), which means they act like an ordinary keyboard. The default mode of operation is to "type" out the barcode, followed by an "Enter". Some barcode scanners are highly configurable, often through scanning configuration barcodes from a chart, allowing you to change this behavior.
The only gotcha is special characters - this depends on what you are scanning.
The good news is that there is no need to write any special controls or extensions or plugins. All you need to do is auto focus on the input control and accept the form based on the enter key being pressed.