From f87efbbd091231c0fcd44361ea1b06c44ca98b64 Mon Sep 17 00:00:00 2001 From: Alireza Date: Thu, 15 Oct 2015 13:55:53 +0300 Subject: [PATCH 1/2] Fixed issue 1176 A quick hotfix for issue #1176. This may also fix any other issues with the key combination which are raised because of stripped Ctrl+ and Ctrl+Shift+ in Qt code. --- .../src/widgets/widgets/qwidgettextcontrol.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 f3de5397c2280b..0bab479c90f64c 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 @@ -74,6 +74,7 @@ #include #include #include +#include #ifndef QT_NO_SHORTCUT #include "private/qapplication_p.h" @@ -1341,11 +1342,15 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e) process: { - // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards - if (e->modifiers() == Qt::ControlModifier - || e->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) { - e->ignore(); - return; + if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) + { + // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards + // + if (e->modifiers() == Qt::ControlModifier + || e->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) { + 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)) { From 2e9ea061d036237476161ecec42e2e3f121d1f92 Mon Sep 17 00:00:00 2001 From: Alireza Date: Thu, 15 Oct 2015 13:55:53 +0300 Subject: [PATCH 2/2] Fixed issue 1176 A quick hotfix for issue #1176. This may also fix any other issues with the key combination which are raised because of stripped Ctrl+ and Ctrl+Shift+ in Qt code. Signed-off-by: Alireza Mim (github: Alireza-Mim) --- .../src/widgets/widgets/qwidgettextcontrol.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 f3de5397c2280b..0bab479c90f64c 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 @@ -74,6 +74,7 @@ #include #include #include +#include #ifndef QT_NO_SHORTCUT #include "private/qapplication_p.h" @@ -1341,11 +1342,15 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e) process: { - // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards - if (e->modifiers() == Qt::ControlModifier - || e->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) { - e->ignore(); - return; + if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) + { + // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards + // + if (e->modifiers() == Qt::ControlModifier + || e->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) { + 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)) {