8000 Qt4Agg does not send backspace key_press_events · Issue #2264 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Qt4Agg does not send backspace key_press_events #2264
Closed
@mrterry

Description

@mrterry

On Mac. Not sure about other platforms.
Gobbles:

  • tab
  • backspace
  • insert
  • delete

Does get:

  • alphanumerics (type=unicode)
  • super/alt/control (str)
  • home/end (str)
  • pageup/pagedown (str)
  • left/right/up/down (str)

Also, alphanumeric keys have different type (unicode) than other keys (str). I'm not sure that's a bug, but it was unexpected.

It would be helpful if others could report on other platforms. This little script will echo your events back:

import matplotlib.pyplot as plt
plt.switch_backend('Qt4Agg')
print(plt.get_backend())

def print_event(event):
    print event.key, type(event.key)

ax = plt.subplot(111)
ax.figure.canvas.mpl_connect('key_press_event', print_event)
ax.figure.canvas.mpl_connect('button_press_event', print_event)
plt.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0