clear some command key and added shortcut ctrl+space

This commit is contained in:
Salvatore Larosa 2012-09-10 22:52:15 +02:00
parent 03877e5885
commit 303f0a6e0a

View File

@ -89,7 +89,7 @@ class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
#self.setTabWidth(4)
self.setAutoCompletionThreshold(1)
self.setAutoCompletionSource(self.AcsAPIs)
self.setAutoCompletionSource(self.AcsAPIs)
# Don't want to see the horizontal scrollbar at all
# Use raw message to Scintilla here (all messages are documented
@ -102,6 +102,22 @@ class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
self.SendScintilla(QsciScintilla.SCI_SETWRAPMODE, 1)
self.SendScintilla(QsciScintilla.SCI_EMPTYUNDOBUFFER)
## Disable command key
ctrl, shift = self.SCMOD_CTRL<<16, self.SCMOD_SHIFT<<16
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('L')+ ctrl)
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('T')+ ctrl)
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('D')+ ctrl)
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('Z')+ ctrl)
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('Y')+ ctrl)
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('L')+ ctrl+shift)
## New QShortcut = ctrl+space for Autocomplete
self.newShortcut = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_Space), self)
self.newShortcut.activated.connect(self.autoComplete)
def autoComplete(self):
self.autoCompleteFromAll()
def clearConsole(self):
"""Clear the contents of the console."""
self.setText('')