Skip to content

Commit b2ceced

Browse files
committed
Merge pull request matplotlib#514 from tonysyu/add-qt4-key-bindings
Add missing qt4 key bindings
2 parents 8c0251e + 9d0c4ba commit b2ceced

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

lib/matplotlib/backends/backend_qt4.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,28 @@ class FigureCanvasQT( QtGui.QWidget, FigureCanvasBase ):
120120
keyvald = { QtCore.Qt.Key_Control : 'control',
121121
QtCore.Qt.Key_Shift : 'shift',
122122
QtCore.Qt.Key_Alt : 'alt',
123-
QtCore.Qt.Key_Return : 'enter'
123+
QtCore.Qt.Key_Return : 'enter',
124+
QtCore.Qt.Key_Left : 'left',
125+
QtCore.Qt.Key_Up : 'up',
126+
QtCore.Qt.Key_Right : 'right',
127+
QtCore.Qt.Key_Down : 'down',
128+
QtCore.Qt.Key_Escape : 'escape',
129+
QtCore.Qt.Key_F1 : 'f1',
130+
QtCore.Qt.Key_F2 : 'f2',
131+
QtCore.Qt.Key_F3 : 'f3',
132+
QtCore.Qt.Key_F4 : 'f4',
133+
QtCore.Qt.Key_F5 : 'f5',
134+
QtCore.Qt.Key_F6 : 'f6',
135+
QtCore.Qt.Key_F7 : 'f7',
136+
QtCore.Qt.Key_F8 : 'f8',
137+
QtCore.Qt.Key_F9 : 'f9',
138+
QtCore.Qt.Key_F10 : 'f10',
139+
QtCore.Qt.Key_F11 : 'f11',
140+
QtCore.Qt.Key_F12 : 'f12',
141+
QtCore.Qt.Key_Home : 'home',
142+
QtCore.Qt.Key_End : 'end',
143+
QtCore.Qt.Key_PageUp : 'pageup',
144+
QtCore.Qt.Key_PageDown : 'pagedown',
124145
}
125146
# left 1, middle 2, right 3
126147
buttond = {1:1, 2:3, 4:2}

0 commit comments

Comments
 (0)