[IPython-dev] Getting autorepeat keyboard events in ipython+matplotlib+PyQt4
Mark Voorhies
mark.voorhies at ucsf.edu
Tue May 5 18:44:42 EDT 2015
On 05/05/2015 09:29 AM, Thomas Kluyver wrote:
> On 4 May 2015 at 23:31, Mark Voorhies <mark.voorhies at ucsf.edu> wrote:
>
>> For the qt backend, however, holding down a key only triggers a single
>> event
>
>
> Does it work correctly when run outside of IPython? I suspect that the
> matplotlib devs will be better able to help you with this.
>
> Thomas
Good thought.
Outside of IPython, keypresses trapped via setting up the PyQt4 signals/slots directly do autorepeat
(e.g.,
sillyAction = actionMenu.addAction(self.tr("Silly"))
sillyAction.setShortcut(QtGui.QKeySequence(self.tr("b")))
self.connect(sillyAction, QtCore.SIGNAL("triggered()"), self.silly)
)
but keypresses trapped via mpl_connect don't autorepeat
(e.g. http://matplotlib.org/examples/user_interfaces/embedding_in_qt4_wtoolbar.html)
Looks like this is a design decision in matplotlib:
-------------------------------------------------------------------------
commit 02870bbdd8185994f0f3d0ccda440b934e8b76c6
Author: Eric Firing <efiring at hawaii.edu>
Date: Sun Apr 17 10:57:22 2011 -1000
BUG: in qt4 backend, ignore auto-repeat keyboard events.
This makes constrained zoom/pan work. I don't see any need
to support keyboard auto-repeat in mpl.
-------------------------------------------------------------------------
If I can't hack around this, I'll contact the matplotlib devs.
Thanks for your help,
Mark
More information about the IPython-dev
mailing list