I've been trying the Qt4Agg backend for matplotlib and I've encountered two
problems. The following code illustrates the issues:

import matplotlib
matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
plt.ion()
plt.plot([1,2,3])
canvas=plt.gcf().canvas

def on_key(event):
    print 'you pressed', event.key, event.xdata, event.ydata

canvas.mpl_connect('key_press_event', on_key)

The problems:
1) The user has to click within the canvas before key press events are
registered. Activating the window is not sufficient.

2) 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?

Thanks,

-Andrew Mark
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to