USB – HID human interface device


With this python script you can capture keyboard (emulators) and barcode scanners trough evdev (event device), this way the part of code will only execute when the device is sending keys:

output:


Another python script example:

Output:


Source: https://stackoverflow.com/questions/19732978/how-can-i-get-a-string-from-hid-device-in-python-with-evdev