Skip to content

Commit 303f0a6

Browse files
committed
clear some command key and added shortcut ctrl+space
1 parent 03877e5 commit 303f0a6

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

python/console_sci.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(self, parent=None):
8989
#self.setTabWidth(4)
9090

9191
self.setAutoCompletionThreshold(1)
92-
self.setAutoCompletionSource(self.AcsAPIs)
92+
self.setAutoCompletionSource(self.AcsAPIs)
9393

9494
# Don't want to see the horizontal scrollbar at all
9595
# Use raw message to Scintilla here (all messages are documented
@@ -102,6 +102,22 @@ def __init__(self, parent=None):
102102
self.SendScintilla(QsciScintilla.SCI_SETWRAPMODE, 1)
103103
self.SendScintilla(QsciScintilla.SCI_EMPTYUNDOBUFFER)
104104

105+
## Disable command key
106+
ctrl, shift = self.SCMOD_CTRL<<16, self.SCMOD_SHIFT<<16
107+
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('L')+ ctrl)
108+
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('T')+ ctrl)
109+
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('D')+ ctrl)
110+
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('Z')+ ctrl)
111+
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('Y')+ ctrl)
112+
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('L')+ ctrl+shift)
113+
114+
## New QShortcut = ctrl+space for Autocomplete
115+
self.newShortcut = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_Space), self)
116+
self.newShortcut.activated.connect(self.autoComplete)
117+
118+
def autoComplete(self):
119+
self.autoCompleteFromAll()
120+
105121
def clearConsole(self):
106122
"""Clear the contents of the console."""
107123
self.setText('')

0 commit comments

Comments
 (0)