Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As we know QRCode or Barcode can be read anywhere, where we place the cursor its should not be like that it should read to a specific texbox and other form elements should not accept QrCode or Barcode pattern.

What I have tried:

As we know QRCode or Barcode can be read anywhere, where we place the cursor its should  not be like that it should read to a specific texbox and other form elements should not accept QrCode or Barcode pattern.
Posted
Updated 2-May-18 21:41pm

1 solution

The problem is not Angular or any framework - it's that most barcode scanners ship set up to emulate a keyboard, and put the data they scan directly into the keyboard queue. Since the queue does not record the source, it just looks like keyboard data, and you can't automatically switch it to any specific location, because you can't tell what was typed by the user, and what was actually scanned - and without that, you can;t put it anywhere special!

There is a solution: you can tell most scanners to provide a "lead in" and "tail out" sequence that your code can identify and direct input appropriately. Unfortunately, the process of telling the scanner is different for each manufacturer (and even for each model in some cases) and the codes are not necessarily fixed or defined either.
So start with the scanner manufacturer and find out how to provide head and tail sequences, from there it should be fairly simple.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900