]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/commitdiff
Don't run not enabled keys
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 26 Jun 2016 17:12:47 +0000 (19:12 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 26 Jun 2016 17:12:47 +0000 (19:12 +0200)
helpers/key.py

index 658c17f485e197d80d089737124f8ec25731a4bb..f49b3ec6a6b9ebc070d45d4803038c61d1715c06 100644 (file)
@@ -80,6 +80,9 @@ class Key(ButtonBehavior, Widget):
         self.actions.append(Action(action_name, self, **arguments))
 
     def do_actions(self):
+        if not self.enabled:
+            return None
+
         print("running actions for {}".format(self.key_sym))
         start_time = time.time()
         self.parent.start_running(self, start_time)