Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately, I don't think this is possible, at least not by using "only Java".</p> <p>Most barcode readers I've seen look just like a keyboard to the computer. If you're using a barcode reader that doesn't operate "as a keyboard", and can be used with the <a href="http://www.oracle.com/technetwork/java/index-jsp-141752.html" rel="nofollow">Java Communications API</a>, then you have some additional options here. Otherwise, I'm assuming that you're using keyboard-type scanners for the rest of this answer.</p> <p>If not within some software written to read the barcode reader output, I could open up Notepad, place the cursor within the window, scan the barcode, and the #'s will appear just as if I had typed them in manually.</p> <p>In order to determine that the entered characters came from the barcode reader rather than the keyboard, you'd need to interface at a lower-level with the OS to determine which input device was used. As far as I know, Java doesn't provide any API for this. You'd need to investigate using JNI, which would then have to be written and maintained per supported operating system.</p> <p>The other possibility is that some scanners will generate special header data as part of the scan. This may be configured into the scanner, or may be part of the barcode itself. In either case, a keyboard listener could be registered to listen for this data, then handle it appropriately. Unfortunately, this doesn't work well from a security perspective, because this means that there are other ways to repeat the input of this data without actually scanning the barcode. (For that matter, if security is a concern, barcodes are the wrong approach - as barcodes can easily be copied or generated.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload