I want a web page that pops up a JavaScript alert when a bar code scan is done. I don’t want to tie the event to any visible control such as a textbox so thus, I won’t have focus on any control to capture the scan input. Can this be done with JQuery?
Share
It is possible to capture key input on the entire page. For example:
I don’t know if the character input from the scanner creates the same keypress events in the DOM as actual key presses, but I’m guessing that it might. My scanner died, but I would be interested to know if this type of technique is feasible.
Keep in mind: without a text input you would have to write your own code to figure out what input constituted a “scanned code” versus other key input, previous key input, and so on. That shouldn’t be terribly hard since a barcode scanner usually inputs very quickly and also outputs a carriage return at the end.