Converts a shortcut string from the notation used in rc config to the standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.
(key_sequence)
| 1028 | |
| 1029 | @staticmethod |
| 1030 | def format_shortcut(key_sequence): |
| 1031 | """ |
| 1032 | Converts a shortcut string from the notation used in rc config to the |
| 1033 | standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'. |
| 1034 | """ |
| 1035 | return (key_sequence if len(key_sequence) == 1 else |
| 1036 | re.sub(r"\+[A-Z]", r"+Shift\g<0>", key_sequence).title()) |
| 1037 | |
| 1038 | def _format_tool_keymap(self, name): |
| 1039 | keymaps = self.toolmanager.get_tool_keymap(name) |