macro_recorder: fix deserialization not merging, crashing on down

main
Ilya Zhuravlev 2020-12-25 13:44:42 -05:00
parent c0bdf2acf7
commit 4ed246c683
1 changed files with 2 additions and 2 deletions

View File

@ -117,7 +117,7 @@ class MacroTab(QVBoxLayout):
if len(sequence) > 0 and isinstance(sequence[-1], list) and sequence[-1][0] == data[0]: if len(sequence) > 0 and isinstance(sequence[-1], list) and sequence[-1][0] == data[0]:
sequence[-1][1].append(data[1]) sequence[-1][1].append(data[1])
else: else:
sequence.append((data[0], [data[1]])) sequence.append([data[0], [data[1]]])
data.pop(0) data.pop(0)
data.pop(0) data.pop(0)
@ -139,7 +139,7 @@ class MacroTab(QVBoxLayout):
keycode = find_keycode(code) keycode = find_keycode(code)
if keycode: if keycode:
keycodes.append(keycode) keycodes.append(keycode)
cls = {SS_TAP_CODE: ActionTap, SS_DOWN_CODE: ActionText, SS_UP_CODE: ActionUp}[s[0]] cls = {SS_TAP_CODE: ActionTap, SS_DOWN_CODE: ActionDown, SS_UP_CODE: ActionUp}[s[0]]
self.add_action(cls(self.container, keycodes)) self.add_action(cls(self.container, keycodes))
def on_change(self): def on_change(self):