diff --git a/mainwindow.cpp b/mainwindow.cpp index 6c0738b..2f4514c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1059,10 +1059,16 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->spotButton->setChecked(m_config.spot_to_psk_reporter()); auto enterFilter = new EnterKeyPressEater(); - connect(enterFilter, &EnterKeyPressEater::enterKeyPressed, this, [this](QKeyEvent *, QObject *){ - if(ui->extFreeTextMsgEdit->isReadOnly()){ + connect(enterFilter, &EnterKeyPressEater::enterKeyPressed, this, [this](QObject *, QKeyEvent *, bool *pProcessed){ + if(QApplication::keyboardModifiers() & Qt::ShiftModifier){ + if(pProcessed) *pProcessed = false; return; } + if(ui->extFreeTextMsgEdit->isReadOnly()){ + if(pProcessed) *pProcessed = false; + return; + } + if(pProcessed) *pProcessed = true; toggleTx(true); }); ui->extFreeTextMsgEdit->installEventFilter(enterFilter); diff --git a/mainwindow.h b/mainwindow.h index 820c17f..da4b9a6 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -920,8 +920,11 @@ protected: if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event); if(keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return){ - emit this->enterKeyPressed(keyEvent, obj); - return true; + bool processed = false; + emit this->enterKeyPressed(obj, keyEvent, &processed); + if(processed){ + return true; + } } } @@ -930,7 +933,7 @@ protected: } public: - Q_SIGNAL void enterKeyPressed(QKeyEvent *evt, QObject *obj); + Q_SIGNAL void enterKeyPressed(QObject *obj, QKeyEvent *evt, bool *pProcessed); }; extern int killbyname(const char* progName);