From 6e4bf8e77f3a3a1c27934b5b5191f64e36569185 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sat, 2 Dec 2023 23:50:03 +0800 Subject: [PATCH] [65_6] Qt 6: Fix Option+Command+key and Ctrl+Command+key part3 --- src/Plugins/Qt/QTMWidget.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Plugins/Qt/QTMWidget.cpp b/src/Plugins/Qt/QTMWidget.cpp index 873caf5141..eddca5ebc7 100644 --- a/src/Plugins/Qt/QTMWidget.cpp +++ b/src/Plugins/Qt/QTMWidget.cpp @@ -474,12 +474,18 @@ QTMWidget::keyReleaseEvent (QKeyEvent* event) { if (key >= 32 && key < 128) { if ((mods & Qt::ShiftModifier) == 0 && key >= 65 && key <= 90) key+= 32; r= string ((char) key); - if (mods & Qt::AltModifier) { - r= "M-A-" * r; - } - if (mods & Qt::MetaModifier) { - r= "M-C-" * r; - } + } + else if (qtkeymap->contains (key)) { + r= qtkeymap[key]; + } + else { + return; + } + if (mods & Qt::AltModifier) { + r= "M-A-" * r; + } + if (mods & Qt::MetaModifier) { + r= "M-C-" * r; } if (DEBUG_QT && DEBUG_KEYBOARD) debug_qt << "key press: " << r << LF; the_gui->process_keypress (tm_widget (), r, texmacs_time ());