Skip to content
Permalink
Browse files

fix issue with home key

  • Loading branch information
slarosa committed Sep 10, 2012
1 parent 303f0a6 commit 02b687321adf35d0a588698023e71470eda8650d
Showing with 10 additions and 5 deletions.
  1. +10 −5 python/console_sci.py
@@ -89,8 +89,8 @@ 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
# here: http://www.scintilla.org/ScintillaDoc.html)
@@ -111,9 +111,11 @@ def __init__(self, parent=None):
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)
## New QShortcut = ctrl+space/ctrl+alt+space for Autocomplete
self.newShortcutCS = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_Space), self)
self.newShortcutCAS = QShortcut(QKeySequence(Qt.CTRL + Qt.ALT + Qt.Key_Space), self)
self.newShortcutCS.activated.connect(self.autoComplete)
self.newShortcutCAS.activated.connect(self.autoComplete)

def autoComplete(self):
self.autoCompleteFromAll()
@@ -360,6 +362,9 @@ def keyPressEvent(self, e):
elif self.is_cursor_on_last_line():
self.SendScintilla(QsciScintilla.SCI_CLEAR)
e.accept()
elif e.key() == Qt.Key_Home:
self.setCursorPosition(linenr,4)
self.ensureCursorVisible()
elif e.key() == Qt.Key_Down and not self.isListActive():
self.showPrevious()
elif e.key() == Qt.Key_Up and not self.isListActive():

0 comments on commit 02b6873

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