You can do it if you can require your end users to have JavaScript enabled.
If you can require that all your users use a scanner that will press return after entering the text, that will make life much easier as well, otherwise you'll be writing extra JavaScript.
You will need to find a free or commercial control that can generate the types of bar codes you plan to use.
Whenever the user has decided to start scanning, they will need to click a button. The button can either set focus on a input box on the same page or it can redirect you to a new page with an input box that is focused on page load.
In either case, with a scanner that presses return for them, each scan should submit the form. When the page reloads, JavaScript should and automatically focus the input box again and be ready for another scan.
If users do not have a scanner that presses return for them then it's pretty much the same but you will have to setup a
timer to monitor the input box and write your own logic to determine if the user has scanned something.
Most importantly, you will need to use a search engine and search for examples of anything you don't know how to do and make an solid effort to complete each task yourself before asking for help. Be sure to ask JavaScript questions in the JavaScript forum.