I have read that some USB devices emulate a keyboard and the information these devices send will be as if the information was typed on a keyboard. For example: a magnetic card reader can use an emulated keyboard to give information about the card.This is a question I had asked about keyboard, BT keyboard and stdin which explains how they work. So where does an application have to listen to the input generated by an emulated keyboard?
How does an emulated keyboard work?
linux;usb;keyboard;hid
If you hook up two USB keyboards to your system, or a USB keyboard to a laptop with built-in keyboard, you can alternately type characters on each one (or use the left on one keyboard and the right on the other. The emulating devices have nothing more to do than tell the system they are a keyboard, just like a keyboard would do and characters coming from the device will be inserted in the right queue. The application just listens like it would for normal keyboard input.There are other ways to get the same result, I used to have a barcode scanner from before the USB era, that had to be physically inserted between the keyboard and the mainboard (using female and male PS/2 connectors), one scan would act as if you pressed the number sequence of the barcode in quick succession. Special keys like Fn modify the keycode of other keys sent by the keyboard, so you cannot press Fn on one keyboard and expect the key on the other keyboard to be modified. 