##// END OF EJS Templates
Fix for issue 173.
epatters -
Show More
@@ -91,14 +91,20 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
91
91
92 #------ Protected class variables ------------------------------------------
92 #------ Protected class variables ------------------------------------------
93
93
94 # When the control key is down, these keys are mapped.
94 _ctrl_down_remap = { QtCore.Qt.Key_B : QtCore.Qt.Key_Left,
95 _ctrl_down_remap = { QtCore.Qt.Key_B : QtCore.Qt.Key_Left,
95 QtCore.Qt.Key_F : QtCore.Qt.Key_Right,
96 QtCore.Qt.Key_F : QtCore.Qt.Key_Right,
96 QtCore.Qt.Key_A : QtCore.Qt.Key_Home,
97 QtCore.Qt.Key_A : QtCore.Qt.Key_Home,
97 QtCore.Qt.Key_E : QtCore.Qt.Key_End,
98 QtCore.Qt.Key_P : QtCore.Qt.Key_Up,
98 QtCore.Qt.Key_P : QtCore.Qt.Key_Up,
99 QtCore.Qt.Key_N : QtCore.Qt.Key_Down,
99 QtCore.Qt.Key_N : QtCore.Qt.Key_Down,
100 QtCore.Qt.Key_D : QtCore.Qt.Key_Delete, }
100 QtCore.Qt.Key_D : QtCore.Qt.Key_Delete, }
101 if not sys.platform == 'darwin':
102 # On OS X, Ctrl-E already does the right thing, whereas End moves the
103 # cursor to the bottom of the buffer.
104 _ctrl_down_remap[QtCore.Qt.Key_E] = QtCore.Qt.Key_End
101
105
106 # The shortcuts defined by this widget. We need to keep track of these to
107 # support 'override_shortcuts' above.
102 _shortcuts = set(_ctrl_down_remap.keys() +
108 _shortcuts = set(_ctrl_down_remap.keys() +
103 [ QtCore.Qt.Key_C, QtCore.Qt.Key_G, QtCore.Qt.Key_O,
109 [ QtCore.Qt.Key_C, QtCore.Qt.Key_G, QtCore.Qt.Key_O,
104 QtCore.Qt.Key_V ])
110 QtCore.Qt.Key_V ])
@@ -172,8 +178,8 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
172 action.setEnabled(True)
178 action.setEnabled(True)
173 printkey = QtGui.QKeySequence(QtGui.QKeySequence.Print)
179 printkey = QtGui.QKeySequence(QtGui.QKeySequence.Print)
174 if printkey.matches("Ctrl+P") and sys.platform != 'darwin':
180 if printkey.matches("Ctrl+P") and sys.platform != 'darwin':
175 # only override if there is a collision
181 # Only override the default if there is a collision.
176 # Qt ctrl = cmd on OSX, so the match gets a false positive on darwin
182 # Qt ctrl = cmd on OSX, so the match gets a false positive on darwin.
177 printkey = "Ctrl+Shift+P"
183 printkey = "Ctrl+Shift+P"
178 action.setShortcut(printkey)
184 action.setShortcut(printkey)
179 action.triggered.connect(self.print_)
185 action.triggered.connect(self.print_)
General Comments 0
You need to be logged in to leave comments. Login now