From 74f15c99ce5b17941e5a41896bf9bfd8e51baf34 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Fri, 3 Mar 2023 16:41:16 +0100 Subject: [PATCH] Terminal: Fix Ctrl+[A-Z] and '|' Change-Id: Id245a015d6092236c20634c47af682bcf073d982 Reviewed-by: Cristian Adam --- src/plugins/terminal/terminalwidget.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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); } }