Hallo, ich habe ein Problem.
ich nehme an einem Wettbewerb teil und habe eine Frage zum Thema Mausrad abfragen.
Das ist mein Code:
import struct
import binhex
file = open("/dev/input/by-id/usb-192f_USB_Optical_Mouse-event-mouse","rb")
print"bla"
while True:
fehler = 0
byte = file.read(16)
h = ":".join("{:02x}".format(ord(c)) for c in byte)
print "byte=",h
# h = ":".join(":02x)".format(ord(c)) for c in byte)
# print "byte=",h
#(type,code,value) = struct.unpack_from("hhi", byte, offset=8)
#if type == 2:
#if code == 8:
#print"läuft"
#else:
#print"fehler"
Nun mein Problem: es wird zwar gezeigt ob sich das Mausrad dreht, allerdings passiert nichts wenn es sich nicht dreht. und genau das ist wichtig bei meinem Projekt. Also im Klartext, ich muss einsehen können ob sich das Rad dreht und auch wenn es sich nicht dreht.
Ich freue mich jetzt schon auf eure Hilfe.
Grüße Sebo