FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUG: in qt4 backend, ignore auto-repeat keyboard events. by efiring · Pull Request #86 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) No extension  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 4 additions & 0 deletions CHANGELOG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2011-04-17 Disable keyboard auto-repeat in qt4 backend by ignoring
key events resulting from auto-repeat. This makes
constrained zoom/pan work. - EF

2011-04-03 Fixed broken pick interface to AsteriskCollection objects
used by scatter. - EF

Expand Down
6 changes: 6 additions & 0 deletions lib/matplotlib/backends/backend_qt4.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,15 @@ def wheelEvent( self, event ):

def keyPressEvent( self, event ):
key = self._get_key( event )
if key is None:
return
FigureCanvasBase.key_press_event( self, key )
if DEBUG: print 'key press', key

def keyReleaseEvent( self, event ):
key = self._get_key(event)
if key is None:
return
FigureCanvasBase.key_release_event( self, key )
if DEBUG: print 'key release', key

Expand All @@ -236,6 +240,8 @@ def minumumSizeHint( self ):
return QtCore.QSize( 10, 10 )

def _get_key( self, event ):
if event.isAutoRepeat():
return None
if event.key() < 256:
key = str(event.text())
elif event.key() in self.keyvald:
Expand Down

Back | FazBrowse Home | New Git URL