MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _is_valid_shortcut

Method _is_valid_shortcut

lib/matplotlib/backends/backend_gtk4.py:570–577  ·  view source on GitHub ↗

Check for a valid shortcut to be displayed. - GTK will never send 'cmd+' (see `FigureCanvasGTK4._get_key`). - The shortcut window only shows keyboard shortcuts, not mouse buttons.

(self, key)

Source from the content-addressed store, hash-verified

568 return ''.join(mods) + key
569
570 def _is_valid_shortcut(self, key):
571 """
572 Check for a valid shortcut to be displayed.
573
574 - GTK will never send 'cmd+' (see `FigureCanvasGTK4._get_key`).
575 - The shortcut window only shows keyboard shortcuts, not mouse buttons.
576 """
577 return 'cmd+' not in key and not key.startswith('MouseButton.')
578
579 def trigger(self, *args):
580 section = Gtk.ShortcutsSection()

Callers 1

triggerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected