Modifier key press events not recognized on MacOSX backend · Issue #20486 · matplotlib/matplotlib · GitHub
Skip to content

Modifier key press events not recognized on MacOSX backend #20486

Description

@Pixadus

Bug report

Bug summary

Key press events identify every key, except modifiers (control, option, command and shift). This behaviour is different from that of Linux and Windows where modifiers are recognized. This behaviour is identical to what was presented in #9835, and supposedly fixed in #9836.

Code for reproduction

import matplotlib.pyplot as plt
fig = plt.figure()

def on_key(event):
    print('you pressed', event.key, event.xdata, event.ydata)

fig.canvas.mpl_connect('key_press_event', on_key)
plt.show()

Actual outcome

All characters recognized, except modifier keys.

Expected outcome

We should be seeing identifiers, such as shift and control as output from the above script.

Matplotlib version

  • Operating system: MacOS Big Sur 11.4
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.4.2
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.9.5
  • Jupyter version (if applicable): n/a
  • Other libraries: n/a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions