Sfoglia il codice sorgente

ctkConsole: Added direct backspace key handling

This is required as there seems to be no QKeySequence for
backspace (see qtextcontrol.cpp)

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 10 anni fa
parent
commit
0538685b73
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      Libs/Widgets/ctkConsole.cpp

+ 3 - 1
Libs/Widgets/ctkConsole.cpp

@@ -329,7 +329,9 @@ void ctkConsolePrivate::keyPressEvent(QKeyEvent* e)
     return;
     }
 
-  if (e == QKeySequence::Back)
+  // There seems to be no QKeySequence for backspace, therefore the key 
+  // has to be recognized directly (the same way as it is done in the parent class)
+  if (e->key() == Qt::Key_Backspace && !(e->modifiers() & ~Qt::ShiftModifier))
     {
     e->accept();
     if(text_cursor.position() > this->InteractivePosition)