mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 04:48:09 -06:00
Changes to keystrokes are reflected in keystroke editor automatically
This commit is contained in:
parent
656b031c5c
commit
32dd232350
@ -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("+"):
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user