Thanks to visit codestin.com
Credit goes to github.com

Skip to content

incompatibility with mpl 3.4 #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tacaswell opened this issue Mar 17, 2021 · 1 comment · Fixed by #310
Closed

incompatibility with mpl 3.4 #309

tacaswell opened this issue Mar 17, 2021 · 1 comment · Fixed by #310

Comments

@tacaswell
Copy link
Member

Describe the issue

matplotlib/matplotlib#19146 made changes to how we encode keyboard events on the js side to ship back to the Python side.

This PR greatly improved the uniformity of handling the keyboard, but think we need to port the js side changes of https://github.com/matplotlib/matplotlib/pull/19146/files?file-filters%5B%5D=.js#diff-179115fdfd653499287a838c855c18302928eccf4d4878acb93da98701246d0d to ipympl or locally restore the old implementation of _handle_key.

@tacaswell
Copy link
Member Author

# %%

%matplotlib widget
import matplotlib.pyplot as plt
import ipywidgets as widgets

# %%

fig, ax = plt.subplots()

# %%
out = []

txt = widgets.Text()

def handler(event):
    out.append(event)
    txt.value = event.key

fig.canvas.mpl_connect('key_press_event', handler)

display(txt)

tacaswell added a commit to tacaswell/jupyter-matplotlib that referenced this issue Mar 17, 2021
tacaswell added a commit to tacaswell/jupyter-matplotlib that referenced this issue Mar 17, 2021
tacaswell added a commit to tacaswell/jupyter-matplotlib that referenced this issue Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant