import usb.core import usb.util import sys dev = usb.core.find(idVendor=0x16c0, idProduct=0x05df) if dev is None: sys.exit("No found in the system"); dev.set_configuration() while 1: cadena = "" for i in dev.read(0x81,64,timeout=0): cadena += chr(i) print cadena
ну вот работает немного нестабильно
сообщения приходят так
button up. button down : 8 button up. button down :9 button up. button down :10 button u p. button down :11 button up. button down : 12 button up. button down :13 button up. button down :14 button u
а должны вот так
button down :15 button up. button down :16 button up. button down :17 button up. button down :18 button up. button down :19 button up. button down :20 button up. button down :21 button up.
без пробелов итд
может кто может чем помочь?