Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8, 6.9
-
None
Description
https://codereview.qt-project.org/c/qt/qtbase/+/597187 added this feature in a way that allows applications to continue handling control-enter for themselves. That's good for backwards compatibility but it turns out that Qt Quick's TextEdit and the QTextEdit widget are handling control-enter already. We have shortcuts defined like this:
$ grep Separator src/gui/kernel/qplatformtheme.cpp {QKeySequence::InsertParagraphSeparator,0, Qt::Key_Enter, KB_All}, {QKeySequence::InsertParagraphSeparator,0, Qt::Key_Return, KB_All}, {QKeySequence::InsertLineSeparator, 0, Qt::META | Qt::Key_Enter, KB_Mac}, {QKeySequence::InsertLineSeparator, 0, Qt::META | Qt::Key_Return, KB_Mac}, {QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Enter, KB_All}, {QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Return, KB_All}, {QKeySequence::InsertLineSeparator, 0, Qt::META | Qt::Key_O, KB_Mac}, and meta is control on macOS
In QtQuick they are handled like this:
void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e) ... #if QT_CONFIG(shortcut) else if (e == QKeySequence::InsertParagraphSeparator) { qDebug() << "InsertParagraphSeparator"; cursor.insertBlock(); e->accept(); goto accept; } else if (e == QKeySequence::InsertLineSeparator) { qDebug() << "InsertLineSeparator"; cursor.insertText(QString(QChar::LineSeparator)); e->accept(); goto accept; } #endif
https://codereview.qt-project.org/c/qt/qtdeclarative/+/642405 succeeds in adding support for the menu key on Windows but not on macOS so far.
Attachments
Issue Links
- replaces
-
QTBUG-136253 Menu key on Windows doesn't open the context menu on the focused item
-
- Closed
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-136577 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
644218,1 | macOS: Always treat Ctrl+Return as context menu instead of trying key event | dev | qt/qtbase | Status: DEFERRED | 0 | 0 |