import matplotlib import matplotlib.pyplot as plt print matplotlib.__version__ print plt.get_backend() def key_event(e): print e.key fig = plt.figure() fig.canvas.mpl_connect('key_press_event', key_event) plt.show()
I'm interested in the key event handlers for keystrokes with modifiers (e.g. Ctrl, Alt, Shift) in matplotlib / pyplot. This part of the documentation mentions some modifier support. But when I use the code above, I do not see this behavior.
I would prefer to avoid the need to manually process modifiers while maintaining the state of these key / release events; for example, I want to be able to easily distinguish between a and ctrl + a without having to maintain up / down control state.
-Am did I miss some higher level interface somewhere where modifiers just work?
-It is possible that some of the documents apply only to the GTKAgg backend, when do I use TkAgg at all?
-Maybe there is support for modifiers, perhaps something that has been added recently and is not in my version of matplotlib 1.1.1rc?
source share