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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With