diff --git a/lib/matplotlib/backends/_backend_tk.py b/lib/matplotlib/backends/_backend_tk.py index 7aa24e06ff8d..e29b5a7be320 100644 --- a/lib/matplotlib/backends/_backend_tk.py +++ b/lib/matplotlib/backends/_backend_tk.py @@ -354,7 +354,7 @@ def _mpl_modifiers(event, *, exclude=None): ("ctrl", 1 << 2, "control"), ("alt", 1 << 4, "alt"), ("shift", 1 << 0, "shift"), - ("super", 1 << 3, "super"), + ("cmd", 1 << 3, "cmd"), ] if sys.platform == "darwin" else [ ("ctrl", 1 << 2, "control"), ("alt", 1 << 3, "alt"), diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 503c5e197d77..919c6d869e5c 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -2169,6 +2169,9 @@ def _unikey_or_keysym_to_mplkey(unikey, keysym): key = key.replace("page_", "page") if key.endswith(("_l", "_r")): # alt_l, ctrl_l, shift_l. key = key[:-2] + if sys.platform == "darwin" and key == "meta": + # meta should be reported as command on mac + key = "cmd" key = { "return": "enter", "prior": "pageup", # Used by tk.