I’ve been trying the Qt4Agg backend for matplotlib and I’ve encountered two problems. The following code illustrates the issues:
import matplotlib.pyplot as plt
print ‘you pressed’, event.key, event.xdata, event.ydata
The user has to click within the canvas before key press events are registered. Activating the window is not sufficient.
Keys ‘up’, ‘down’, ‘left’, ‘right’, ‘pageup’, and ‘pagedown’ all return event.key=None.
The tkagg and gtkagg backends don’t have these problems - key press events are active as soon as the window is active, and event.key reports the correct key. Does anyone have an idea why these problems are cropping up with Qt4 or know a workaround?