]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - helpers/key.py
Some new features:
[perso/Immae/Projets/Python/MusicSampler.git] / helpers / key.py
index 658c17f485e197d80d089737124f8ec25731a4bb..5eaf481bea86a4d2aa962be2b4bd035a0692bc8e 100644 (file)
@@ -79,15 +79,22 @@ class Key(ButtonBehavior, Widget):
     def add_action(self, action_name, **arguments):
         self.actions.append(Action(action_name, self, **arguments))
 
+    def interrupt_action(self):
+        self.current_action.interrupt()
+
     def do_actions(self):
+        if not self.enabled:
+            return None
+
+        self.parent.parent.ids['KeyList'].append(self.key_sym)
         print("running actions for {}".format(self.key_sym))
         start_time = time.time()
         self.parent.start_running(self, start_time)
         action_number = 0
-        for action in self.actions:
+        for self.current_action in self.actions:
             if self.parent.keep_running(self, start_time):
                 self.list_actions(action_number = action_number + 0.5)
-                action.run()
+                self.current_action.run()
                 action_number += 1
                 self.list_actions(action_number = action_number)