From c9d73807e836f0459198484c611f7159daf82a92 2010-10-26 21:24:15 From: MinRK Date: 2010-10-26 21:24:15 Subject: [PATCH] print shortcut -> ctrl+shift+P if there is a collision with ctrl+P --- diff --git a/IPython/frontend/qt/console/console_widget.py b/IPython/frontend/qt/console/console_widget.py index 354d080..202a2eb 100644 --- a/IPython/frontend/qt/console/console_widget.py +++ b/IPython/frontend/qt/console/console_widget.py @@ -170,7 +170,12 @@ class ConsoleWidget(Configurable, QtGui.QWidget): # Configure actions. action = QtGui.QAction('Print', None) action.setEnabled(True) - action.setShortcut(QtGui.QKeySequence.Print) + 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 + printkey = "Ctrl+Shift+P" + action.setShortcut(printkey) action.triggered.connect(self.print_) self.addAction(action) self._print_action = action