Parcourir la source

ctkConsole: Do not allow moving before the interactive position

This commit fixes regression introduced by the following
commits:
* b1f69f2 (ENH: Removed low-level key processing from ctkConsolePrivate::keyPressEvent)
* cac06a2 (BUG: Fixed more keyboard shortcuts in console)
* aaaa638 (BUG: Fixed Console Shift+Home behavior)
Andras Lasso il y a 10 ans
Parent
commit
6b301fb0ac
1 fichiers modifiés avec 24 ajouts et 0 suppressions
  1. 24 0
      Libs/Widgets/ctkConsole.cpp

+ 24 - 0
Libs/Widgets/ctkConsole.cpp

@@ -186,6 +186,30 @@ bool ctkConsolePrivate::isMoveLeftWithinLine(QKeyEvent* e, QTextCursor::MoveOper
     moveMode = QTextCursor::KeepAnchor;
     moveMode = QTextCursor::KeepAnchor;
     return true;
     return true;
     }
     }
+  else if (e == QKeySequence::MoveToStartOfBlock)
+    {
+    moveOperation = QTextCursor::StartOfLine;
+    moveMode = QTextCursor::MoveAnchor;
+    return true;
+    }
+  else if (e == QKeySequence::SelectStartOfBlock)
+    {
+    moveOperation = QTextCursor::StartOfLine;
+    moveMode = QTextCursor::KeepAnchor;
+    return true;
+    }
+  else if (e == QKeySequence::MoveToStartOfDocument)
+    {
+    moveOperation = QTextCursor::StartOfLine;
+    moveMode = QTextCursor::MoveAnchor;
+    return true;
+    }
+  else if (e == QKeySequence::SelectStartOfDocument)
+    {
+    moveOperation = QTextCursor::StartOfLine;
+    moveMode = QTextCursor::KeepAnchor;
+    return true;
+    }
   else
   else
     {
     {
     return false;
     return false;