chan, key = [int(v) for v in message.split(None, 1)]
self.synth.noteoff(chan, key)
+ elif eventName.startswith('COL') :
+ pos = [int(n) for n in message.split(None, 4)[-1].strip('()').split(',')]
+ self.cursor.setPosition(pos)
+
pygame.event.clear() # à virer
#EventDispatcher.dispatchEvents()
def move(self, event) :
self.dirty = 1
self.rect.move_ip(event.rel)
+
+ def setPosition(self, pos) :
+ self.dirty = 1
+ x, y = pos
+ rx, ry = self.rect.centerx, self.rect.centery
+ self.rect.move_ip(x-rx, y-ry)