From 8fba70be839a0d40da1bd9fdd38b73cd4939259e 2011-02-10 18:43:13 From: epatters Date: 2011-02-10 18:43:13 Subject: [PATCH] Fix for issue 173. --- diff --git a/IPython/frontend/qt/console/console_widget.py b/IPython/frontend/qt/console/console_widget.py index a6e0cba..eb419bf 100644 --- a/IPython/frontend/qt/console/console_widget.py +++ b/IPython/frontend/qt/console/console_widget.py @@ -91,14 +91,20 @@ class ConsoleWidget(Configurable, QtGui.QWidget): #------ Protected class variables ------------------------------------------ + # When the control key is down, these keys are mapped. _ctrl_down_remap = { QtCore.Qt.Key_B : QtCore.Qt.Key_Left, QtCore.Qt.Key_F : QtCore.Qt.Key_Right, QtCore.Qt.Key_A : QtCore.Qt.Key_Home, - QtCore.Qt.Key_E : QtCore.Qt.Key_End, QtCore.Qt.Key_P : QtCore.Qt.Key_Up, QtCore.Qt.Key_N : QtCore.Qt.Key_Down, QtCore.Qt.Key_D : QtCore.Qt.Key_Delete, } + if not sys.platform == 'darwin': + # On OS X, Ctrl-E already does the right thing, whereas End moves the + # cursor to the bottom of the buffer. + _ctrl_down_remap[QtCore.Qt.Key_E] = QtCore.Qt.Key_End + # The shortcuts defined by this widget. We need to keep track of these to + # support 'override_shortcuts' above. _shortcuts = set(_ctrl_down_remap.keys() + [ QtCore.Qt.Key_C, QtCore.Qt.Key_G, QtCore.Qt.Key_O, QtCore.Qt.Key_V ]) @@ -172,8 +178,8 @@ class ConsoleWidget(Configurable, QtGui.QWidget): action.setEnabled(True) printkey = QtGui.QKeySequence(QtGui.QKeySequence.Print) if printkey.matches("Ctrl+P") and sys.platform != 'darwin': - # only override if there is a collision - # Qt ctrl = cmd on OSX, so the match gets a false positive on darwin + # Only override the default if there is a collision. + # Qt ctrl = cmd on OSX, so the match gets a false positive on darwin. printkey = "Ctrl+Shift+P" action.setShortcut(printkey) action.triggered.connect(self.print_)