更新到matplotlib prepends'alt'keyrelease event.key

我从v1.1更新了matplotlib到v1.2.0 win32。 我使用mpl_connect来处理keyevents。 在我用来检查keyrelease event.key的地方,例如'q'或'escape',现在所有的键都是'alt + q','alt + escape'。 任何想法为什么?

示例代码:

import matplotlib.pyplot as plt def close_fig(event): print event.key if event.key == 'q': plt.close(event.canvas.figure) fig = plt.figure() ax = fig.add_subplot(111) fig.canvas.mpl_connect('key_release_event', close_fig) data = [0,10,11,12] ax.plot(data) plt.show() 

这看起来像添加到matplotlib v1.2中的修饰键逻辑中的一个bug。 请将此示例报告给matplotlib问题跟踪器https://github.com/matplotlib/matplotlib/issues/new ,上面的示例以及http://matplotlib.org/faq/troubleshooting_faq.html#getting-帮助 。 尤其是,这很可能是后端问题,所以请提供您正在使用的后端操作系统信息。

谢谢!