条码扫描器的JavaScript?或插件/扩展 [英] barcode scanner in JavaScript? Or plugin/extension

查看:333
本文介绍了条码扫描器的JavaScript?或插件/扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑编写一个USB条形码扫描器界面到一个Web应用程序(离线应用程序)。通过这个我的意思是扫描仪将在客户机上,而不是服务器。所以我想知道最好的设计是什么。

我知道我可以写一个ActiveX对象或本机插件到一些浏览器,但这不是理想的,有没有人知道如果Chrome扩展(在JavaScript中)或Firefox的Jetpack将支持这种功能。



任何想法?

感谢所有



Guido


< USB条形码扫描仪实现一个HID设备(无论如何),这意味着他们的行为就像一个普通的键盘。操作的默认模式是输入条形码,然后是Enter。一些条形码扫描仪是高度可配置的,通常通过从图表扫描配置条形码,允许您改变这种行为。



唯一的疑难杂症是特殊字符 - 这取决于你正在扫描。



好消息是,不需要编写任何特殊的控件或扩展或插件。所有你需要做的是自动对焦输入控件,并接受基于被按下的回车键的形式。


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

解决方案

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.

这篇关于条码扫描器的JavaScript?或插件/扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆