File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 2011-04-17 Disable keyboard auto-repeat in qt4 backend by ignoring
2+ key events resulting from auto-repeat. This makes
3+ constrained zoom/pan work. - EF
4+
152011-04-14 interpolation="nearest" always interpolate images. A new
26 mode "none" is introduced for no interpolation - JJL
37
Original file line number Diff line number Diff line change @@ -212,11 +212,15 @@ def wheelEvent( self, event ):
212212
213213 def keyPressEvent ( self , event ):
214214 key = self ._get_key ( event )
215+ if key is None :
216+ return
215217 FigureCanvasBase .key_press_event ( self , key )
216218 if DEBUG : print 'key press' , key
217219
218220 def keyReleaseEvent ( self , event ):
219221 key = self ._get_key (event )
222+ if key is None :
223+ return
220224 FigureCanvasBase .key_release_event ( self , key )
221225 if DEBUG : print 'key release' , key
222226
@@ -241,6 +245,8 @@ def minumumSizeHint( self ):
241245 return QtCore .QSize ( 10 , 10 )
242246
243247 def _get_key ( self , event ):
248+ if event .isAutoRepeat ():
249+ return None
244250 if event .key () < 256 :
245251 key = str (event .text ())
246252 elif event .key () in self .keyvald :
You can’t perform that action at this time.
0 commit comments