I have a barcode scanner (a Motorola Symbol LS4208) which scans codes and writes them where the mouse focus is at that moment( a word file, a form field). The scanner is connected via USB. I want to write a Java application that listens continuouslly and intercepts all the results received from the scanner. How can I write this program? The scanner acts like a keyboard so I can use something like KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher, but how would I differenciate from a user keyboard input and the scanner?
            Asked
            
        
        
            Active
            
        
            Viewed 1.3k times
        
    3
            
            
        - 
                    in some other SO answer, someone told that you can differenciate the scanner from someone inspecting the speed the string took to be written (but I don't know how to get this from the event) – Leo Mar 18 '14 at 17:22
 - 
                    1Possible duplicate of [Barcode Scanner implementation on Java](https://stackoverflow.com/questions/8146840/barcode-scanner-implementation-on-java) – Jurgen Camilleri Jan 31 '19 at 08:12