Convert 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)
| 892 | |
| 893 | @staticmethod |
| 894 | def format_shortcut(key_sequence): |
| 895 | """ |
| 896 | Convert a shortcut string from the notation used in rc config to the |
| 897 | standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'. |
| 898 | """ |
| 899 | return (key_sequence if len(key_sequence) == 1 else |
| 900 | re.sub(r"\+[A-Z]", r"+Shift\g<0>", key_sequence).title()) |
| 901 | |
| 902 | def _format_tool_keymap(self, name): |
| 903 | keymaps = self.toolmanager.get_tool_keymap(name) |
no outgoing calls