Skip to content

webagg reports incorrect values for non-alphanumeric key events on non-qwerty keyboards #19128

Closed

Description

@anntzer

Bug report

Bug summary

Non alphanumeric key events are reported incorrectly on webagg.

Code for reproduction

MPLBACKEND=webagg python -c 'from pylab import *; plot(); gcf().canvas.mpl_connect("key_press_event", lambda e: print(e.key)); show()'

then press some keys while using e.g. an https://en.wikipedia.org/wiki/AZERTY keyboard layout.

Actual outcome

& is reported as 1, etc.

Expected outcome

Correct keys.

Matplotlib version

  • Operating system: linux
  • Matplotlib version: head
  • Matplotlib backend (print(matplotlib.get_backend())): webagg
  • Python version: 39

From a quick look mpl.js is using https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which + a hard-coded table; MDN says that which is deprecated and suggests using https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key instead.

Activity

  1. tonadev commented on Dec 17, 2020

    @tonadev
    Contributor

    You can reproduce the bug on non-US keyboard layouts. I would like to work on this. Can I work on this?

  2. timhoffm commented on Dec 17, 2020

    @timhoffm
    Member

    👍 You are welcome to.

  3. added a commit that references this issue on Feb 17, 2021
    5ad390d
  4. added this to the v3.4.0 milestone on Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: webagg🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions