Closed
Description
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