Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

barcode scanner in JavaScript? Or plugin/extension

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

like image 472
gatapia Avatar asked Jul 16 '10 05:07

gatapia


1 Answers

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.

like image 54
Yann Ramin Avatar answered Nov 02 '22 23:11

Yann Ramin