I have an app that reads barcode input from a scanner. The scanner is treated as a keyboard (as usual) and I get the scanned input while my app has focus. However durting periods of inactivity my app is killed and then misses any input that may occur.
Since the scanner is a usb device it should be possible to associate it exclusively with my app. I have a usb printer and that is associated with my app by default. So the OS starts my app (if needed) on the USB_ATTACH event of the printer.
How do I get the scanner to be associated by default with my app and ensure my app gets any input from the scanner?