Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Resolved Print shortcut collision with ctrl-P emacs binding #187

Merged
1 commit merged into from

1 participant

@minrk
Owner

Specifically check for a collision, in case of platform-specific Print command that doesn't collide with ctrl-P (e.g. OSX).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 IPython/frontend/qt/console/console_widget.py
View
7 IPython/frontend/qt/console/console_widget.py
@@ -170,7 +170,12 @@ def __init__(self, parent=None, **kw):
# 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
Something went wrong with that request. Please try again.