Ver código fonte

BUG: Enable Ctrl-C shortcut in Python console in the history area

Andras Lasso 10 anos atrás
pai
commit
33845638e9
1 arquivos alterados com 7 adições e 1 exclusões
  1. 7 1
      Libs/Widgets/ctkConsole.cpp

+ 7 - 1
Libs/Widgets/ctkConsole.cpp

@@ -296,7 +296,13 @@ void ctkConsolePrivate::keyPressEvent(QKeyEvent* e)
     }
 
   // Force the cursor back to the interactive area if anything else than copy/paste or page up/down is done
-  if(history_area)
+  // but only when a "real" key is pressed, not just a modifier (otherwise we could not press Control-c in the
+  // history area because the cursor would jump to the interactive area immediately when Control is pressed)
+  if(history_area
+       && e->key() != Qt::Key_Control
+       && e->key() != Qt::Key_Meta
+       && e->key() != Qt::Key_Alt
+       && e->key() != Qt::Key_Shift)
     {
     text_cursor.setPosition(this->documentEnd());
     this->setTextCursor(text_cursor);