使用USB条形码扫描器扫描条形码后,如何模仿键盘按键?我对此没有任何想法,我只想获得一些关于如何做到这一点的建议/指示。如果我有这种形式,条形码号码将如何在该文本框中输入?谢谢!
How can I emulate keyboard press once I scanned a barcode using a usb barcode scanner? I don't have any idea about this and I just want to get some suggestions/instructions on how can I do it. If I have this form, how will the barcode number be inputted in that textbox? thanks!
<form method="post" action=""> <input type="text" id="barcode-input" name="barcode-input" value=""/> </form>推荐答案
我见过的条码扫描器我不得不承认)就像一个键盘一样。旧的甚至有一个PS / 2端口。但即使是USB的人也喜欢将自己标识为键盘。当你扫描一个代码时,扫描仪的行为就好像你实际上已经按下了键盘上的数字键,可能以一个返回键结束。
The barcode scanners that I have seen (not that many I have to admit) act like a keyboard. Old ones even have a PS/2 port. But even the USB ones like to just identify themselves as a keyboard. When you scan a code, the scanner behaves as if you would have actually pressed number keys on your keyboard, probably ending with a return key.
所以你要做的是把重点放在你的文本框中,扫描你的代码并完成。
So what you do is put a focus in your textbox, and scan your code and be done.
更多推荐
Jquery条码扫描器集成
发布评论