diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 8325f2839c7..b0515833076 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -770,13 +770,11 @@ void TerminalWidget::keyPressEvent(QKeyEvent *event) mod = VTERM_MOD_NONE; } - vterm_keyboard_unichar(m_vterm.get(), - event->text().toUcs4()[0], - static_cast(mod & ~VTERM_MOD_CTRL)); + vterm_keyboard_unichar(m_vterm.get(), event->text().toUcs4()[0], VTERM_MOD_NONE); setSelection(std::nullopt); - } else if (mod != VTERM_MOD_NONE && event->key() == Qt::Key_C) { - vterm_keyboard_unichar(m_vterm.get(), 'c', mod); + } else if (mod == VTERM_MOD_CTRL && event->key() >= Qt::Key_A && event->key() < Qt::Key_Z) { + vterm_keyboard_unichar(m_vterm.get(), 'a' + (event->key() - Qt::Key_A), mod); } }