ich habe ein Problem mit einem Fußtaster (3 Tasten) unter Linux Kubuntu 12.04 LTS.
Das Gerät wird ohne Probleme erkannt, nur das Script bleibt irgendwann stehen, leider lässt sich nicht sagen woran( oder besser gesagt ich vermag es nicht).
Ein kleines Testscript das immer nur ausgibt welche Taste gedrückt und losgelassen wird hat das gleiche Problem.
Das Problem tritt an unterschiedlichen Rechnern auf.
Hier mal das Kleine, das Große kann ich gerne auch noch nachreichen.:
Code: Alles auswählen
hidfilename = "/dev/usb/hiddev0"
signal_chars = [4, 12, 20]
WORD_LENGTH = 24
if __name__=="__main__":
print "Depress pedal to test..."
try:
hidfile = open(hidfilename)
except IOError:
print "You need permission to access the device. Type the following:"
print "sudo chmod a+r /dev/usb/hiddev0"
exit(1)
prev_state = [0]*3
while True:
mystring = hidfile.read(WORD_LENGTH)
buttons = [ord(mystring[i]) for i in signal_chars]
print "Current state:", buttons, "Previous state:", prev_state
prev_state = buttons
hidfile.close()Vielen Dank
Sebastian
