File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -824,6 +824,15 @@ def _normalize_shortcut(self, key):
824824
825825 return '' .join (mods ) + key
826826
827+ def _is_valid_shortcut (self , key ):
828+ """
829+ Check for a valid shortcut to be displayed.
830+
831+ - GTK will never send 'cmd+' (see `FigureCanvasGTK3._get_key`).
832+ - The shortcut window only shows keyboard shortcuts, not mouse buttons.
833+ """
834+ return 'cmd+' not in key and not key .startswith ('MouseButton.' )
835+
827836 def _show_shortcuts_window (self ):
828837 section = Gtk .ShortcutsSection ()
829838
@@ -844,8 +853,7 @@ def _show_shortcuts_window(self):
844853 accelerator = ' ' .join (
845854 self ._normalize_shortcut (key )
846855 for key in self .toolmanager .get_tool_keymap (name )
847- # Will never be sent:
848- if 'cmd+' not in key ),
856+ if self ._is_valid_shortcut (key )),
849857 title = tool .name ,
850858 subtitle = tool .description )
851859 group .add (shortcut )
You can’t perform that action at this time.
0 commit comments