>2. It might require some sort of driver to make the camera appear as an auxiliary keyboard or Human Interface Device (HID in MS parlance). There are some apps such as
https://www.microsoft.com/en-us/store/p/scan-qr-code-and-barcode-reader/9wzdncrdr9tp , but they work by processing the captured image and then effectively calling ShellExecute() to bring up a browser if a URL is scanned, NotePad for text etc. Instead, you need straight keyboard emulation. I haven't found anything that does that. Even if you do, you'd first need to ensure #1 above, that the camera is physically capable of resolving a bar code.
Wasn't this a common feature for some brands of cell phones many years ago, or was it a prank video? I didn't see it but someone told me in detail about an app for that phone whereby you just point the camera to the label, press a button and it not only scans athe barcode, but looks it up in a database and tells you everything you need/want to know about the thing bearing the barcode.
Now I don't know whether this was from someone's wishlist (like that grocery tricorder remains on mine) or such an app really exists, but I find lots of trouble in the last sentence. The barcode database would have to be public, freely accessible via a web service, up-to-date and... the "everything you want to know" would be subject to interests of those supplying the data. They would tell you whatever they think you want to hear, and you'd think you were checking the facts...