I am going to use a barcode scanner device that simulates keyboard input (i.e. the system thinks it's a keyboard). All my barcodes begin with a specific prefix (say, "@#@") and end with a specific suffix, which is how I differentiate them from the actual keyboard input.
I need to listen to barcodes globally across the application, which can be accomplished using Toolkit.getDefaultToolkit().addAWTEventListener.
I also need to intercept and suppress barcodes for the rest of my application - e.g. if the focus was on JTextField, it should NOT show the barcode entry. This, I am not sure how to accomplish. Any suggestions?