diff options
Diffstat (limited to 'helpers/key.py')
-rw-r--r-- | helpers/key.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/helpers/key.py b/helpers/key.py index ca73b87..5eaf481 100644 --- a/helpers/key.py +++ b/helpers/key.py | |||
@@ -79,6 +79,9 @@ class Key(ButtonBehavior, Widget): | |||
79 | def add_action(self, action_name, **arguments): | 79 | def add_action(self, action_name, **arguments): |
80 | self.actions.append(Action(action_name, self, **arguments)) | 80 | self.actions.append(Action(action_name, self, **arguments)) |
81 | 81 | ||
82 | def interrupt_action(self): | ||
83 | self.current_action.interrupt() | ||
84 | |||
82 | def do_actions(self): | 85 | def do_actions(self): |
83 | if not self.enabled: | 86 | if not self.enabled: |
84 | return None | 87 | return None |
@@ -88,10 +91,10 @@ class Key(ButtonBehavior, Widget): | |||
88 | start_time = time.time() | 91 | start_time = time.time() |
89 | self.parent.start_running(self, start_time) | 92 | self.parent.start_running(self, start_time) |
90 | action_number = 0 | 93 | action_number = 0 |
91 | for action in self.actions: | 94 | for self.current_action in self.actions: |
92 | if self.parent.keep_running(self, start_time): | 95 | if self.parent.keep_running(self, start_time): |
93 | self.list_actions(action_number = action_number + 0.5) | 96 | self.list_actions(action_number = action_number + 0.5) |
94 | action.run() | 97 | self.current_action.run() |
95 | action_number += 1 | 98 | action_number += 1 |
96 | self.list_actions(action_number = action_number) | 99 | self.list_actions(action_number = action_number) |
97 | 100 | ||