Skip to content

Commit

Permalink
Fixed issue 1176
Browse files Browse the repository at this point in the history
A quick hotfix for issue telegramdesktop#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 <[email protected]> (github: Alireza-Mim)
  • Loading branch information
Alireza-Mim authored and Alireza Mim committed Oct 15, 2015
1 parent 1c28d59 commit 2e9ea06
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include <QtWidgets/qlineedit.h>
#include <QtGui/qaccessible.h>
#include <QtCore/qmetaobject.h>
#include <QLocale.h>

#ifndef QT_NO_SHORTCUT
#include "private/qapplication_p.h"
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 2e9ea06

Please sign in to comment.