Java – read barcode when program has no focus?

I want to write a simple program to read bar code, write down bar code and scanning time Unfortunately, I can't guarantee that the program will have focus when scanning code My understanding is that most bar code scanners are like keyboards, so if the program has no focus, I will encounter problems Is there any way to solve this problem? Note that I prefer to write code in Java, but if the library is easier, I can use it net. I also don't have a specific scanner, so if a model works better, the information will be appreciated I've seen this question, but it assumes that the application has focus

Solution

Most bar code scanners behave like keyboards, so the processing application is required to have input focus However, there are also bar code scanners, which are connected to a serial port or USB and provide a virtual serial port interface

These scanners must be accessed via an actual or virtual serial port For Java, you will need to use the Java Communications API or any other third-party library that provides serial port access, as standard Java APIs cannot do this

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>