Skip to content
Permalink
Browse files

clear some command key and added shortcut ctrl+space

  • Loading branch information
slarosa committed Sep 10, 2012
1 parent 03877e5 commit 303f0a6e0a03ff05db03bb276ed3fb748b92aa7e
Showing with 17 additions and 1 deletion.
  1. +17 −1 python/console_sci.py
@@ -89,7 +89,7 @@ def __init__(self, parent=None):
#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 @@ def __init__(self, parent=None):
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('')

0 comments on commit 303f0a6

Please sign in to comment.
You can’t perform that action at this time.