Add Ctrl+C shortcut to delete line in debug console.

This commit is contained in:
Florian Bruhin 2014-09-25 22:48:49 +02:00
parent d1fdd5e776
commit f421b7174f

View File

@ -131,13 +131,16 @@ class ConsoleLineEdit(misc.CommandLineEdit):
return text[len(self._curprompt()):] return text[len(self._curprompt()):]
def keyPressEvent(self, e): def keyPressEvent(self, e):
"""Override keyPressEvent to handle up/down keypresses.""" """Override keyPressEvent to handle special keypresses."""
if e.key() == Qt.Key_Up: if e.key() == Qt.Key_Up:
self.history_prev() self.history_prev()
e.accept() e.accept()
elif e.key() == Qt.Key_Down: elif e.key() == Qt.Key_Down:
self.history_next() self.history_next()
e.accept() e.accept()
elif e.modifiers() & Qt.ControlModifier and e.key() == Qt.Key_C:
self.setText('')
e.accept()
else: else:
super().keyPressEvent(e) super().keyPressEvent(e)