diff --git a/src/keystrokeEditor/keystrokeEditor.py b/src/keystrokeEditor/keystrokeEditor.py index 5e0e800d..3f47abbc 100644 --- a/src/keystrokeEditor/keystrokeEditor.py +++ b/src/keystrokeEditor/keystrokeEditor.py @@ -28,6 +28,7 @@ class KeystrokeEditor(object): if new_keystroke != self.map[action]: self.changed = True self.map[action] = new_keystroke + self.dialog.put_keystrokes(constants.actions, self.map) def set_keystroke(self, keystroke, dialog): for i in keystroke.split("+"): diff --git a/src/keystrokeEditor/wx_ui.py b/src/keystrokeEditor/wx_ui.py index 700129c9..c8162ffa 100644 --- a/src/keystrokeEditor/wx_ui.py +++ b/src/keystrokeEditor/wx_ui.py @@ -29,6 +29,8 @@ class keystrokeEditorDialog(baseDialog.BaseWXDialog): self.SetClientSize(sizer.CalcMin()) def put_keystrokes(self, actions, keystrokes): + selection = self.keys.get_selected() + self.keys.clear() for i in keystrokes: if actions.has_key(i) == False: continue @@ -36,6 +38,7 @@ class keystrokeEditorDialog(baseDialog.BaseWXDialog): self.actions.append(i) keystroke = keystrokes[i] self.keys.insert_item(False, *[action, keystroke]) + self.keys.select_item(selection) def get_action(self): return self.keys.get_selected()