macro_recorder: merge keys when recording

main
Ilya Zhuravlev 2020-12-25 14:15:18 -05:00
parent 7a75e77e9b
commit 7242138f76
1 changed files with 2 additions and 0 deletions

View File

@ -270,6 +270,8 @@ class MacroRecorder(BasicEditor):
else:
cls = {KeyDown: ActionDown, KeyUp: ActionUp, KeyTap: ActionTap}[type(k)]
self.recording_tab.add_action(cls(self.recording_tab.container, [k.keycode]))
# merge: i.e. replace multiple instances of KeyDown with a single multi-key ActionDown, etc
self.recording_tab.deserialize(self.recording_tab.serialize())
def on_keystroke(self, keystroke):
self.keystrokes.append(keystroke)