Reload the list of action/key binding pairs for the active key set. An action/key binding can be selected to change the key binding.
(self, keyset_name)
| 1461 | self.set_keys_type() |
| 1462 | |
| 1463 | def load_keys_list(self, keyset_name): |
| 1464 | """Reload the list of action/key binding pairs for the active key set. |
| 1465 | |
| 1466 | An action/key binding can be selected to change the key binding. |
| 1467 | """ |
| 1468 | reselect = False |
| 1469 | if self.bindingslist.curselection(): |
| 1470 | reselect = True |
| 1471 | list_index = self.bindingslist.index(ANCHOR) |
| 1472 | keyset = idleConf.GetKeySet(keyset_name) |
| 1473 | # 'set' is dict mapping virtual event to list of key events. |
| 1474 | bind_names = list(keyset) |
| 1475 | bind_names.sort() |
| 1476 | self.bindingslist.delete(0, END) |
| 1477 | for bind_name in bind_names: |
| 1478 | key = ' '.join(keyset[bind_name]) |
| 1479 | bind_name = bind_name[2:-2] # Trim double angle brackets. |
| 1480 | if keyset_name in changes['keys']: |
| 1481 | # Handle any unsaved changes to this key set. |
| 1482 | if bind_name in changes['keys'][keyset_name]: |
| 1483 | key = changes['keys'][keyset_name][bind_name] |
| 1484 | self.bindingslist.insert(END, bind_name+' - '+key) |
| 1485 | if reselect: |
| 1486 | self.bindingslist.see(list_index) |
| 1487 | self.bindingslist.select_set(list_index) |
| 1488 | self.bindingslist.select_anchor(list_index) |
| 1489 | |
| 1490 | @staticmethod |
| 1491 | def save_new_key_set(keyset_name, keyset): |