diff --git a/Telegram/_qt_5_5_0_patch/qtbase/src/widgets/widgets/qwidgetlinecontrol.cpp b/Telegram/_qt_5_5_0_patch/qtbase/src/widgets/widgets/qwidgetlinecontrol.cpp index fbd3064385..ba72f4b573 100644 --- a/Telegram/_qt_5_5_0_patch/qtbase/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/Telegram/_qt_5_5_0_patch/qtbase/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif @@ -1879,10 +1880,17 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) unknown = false; } - // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards - if (unknown && !isReadOnly() - && event->modifiers() != Qt::ControlModifier - && event->modifiers() != (Qt::ControlModifier | Qt::ShiftModifier)) { + // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards + // + bool skip = false; + if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) { + if (event->modifiers() == Qt::ControlModifier + || event->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) { + skip = true; + } + } + + if (unknown && !isReadOnly() && !skip) { QString t = event->text(); if (!t.isEmpty() && (t.at(0).isPrint() || t.at(0).unicode() == 0x200C || t.at(0).unicode() == 0x200D)) { insert(t); diff --git a/Telegram/_qt_5_5_0_patch/qtbase/src/widgets/widgets/qwidgettextcontrol.cpp b/Telegram/_qt_5_5_0_patch/qtbase/src/widgets/widgets/qwidgettextcontrol.cpp index a2d1cb88dd..53dc1bfdbc 100644 --- a/Telegram/_qt_5_5_0_patch/qtbase/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/Telegram/_qt_5_5_0_patch/qtbase/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1342,17 +1342,21 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e) process: { - if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) - { - // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards - // + // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards + // + bool skip = false; + if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) { if (e->modifiers() == Qt::ControlModifier || e->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) { - e->ignore(); - return; + skip = true; } } - QString text = e->text(); + if (skip) { + e->ignore(); + return; + } + + QString text = e->text(); if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t') || text.at(0).unicode() == 0x200C || text.at(0).unicode() == 0x200D)) { if (overwriteMode // no need to call deleteChar() if we have a selection, insertText