summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2020-05-04 14:08:47 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2020-07-07 13:07:23 +0200
commitfd483945e2c86aa0c3fc1465d179d7be39ec86bc (patch)
tree1d99c97b3738c359cd2973a598af243cc2aff058
parent09015f8ee5e48e2211c60b69e7b76b8ce2ac8285 (diff)
Fix AltGr on Windows
Fixes: QTBUG-83710 Change-Id: Iaf5a33c0aeb53348d36cb7dda60602041299cd50 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 53498cb73392a222a113ae257f24f91e6d912518)
-rw-r--r--src/core/web_event_factory.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index fc6287dd9..8042c0914 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -171,8 +171,15 @@ static QString qtTextForKeyEvent(const QKeyEvent *ev, int qtKey, Qt::KeyboardMod
{
QString text = ev->text();
- if ((qtModifiers & Qt::ControlModifier) && keyboardDriver() == KeyboardDriver::Xkb)
+ if (keyboardDriver() == KeyboardDriver::Xkb && (qtModifiers & Qt::ControlModifier)) {
text.clear();
+ }
+
+ // Keep text for Ctrl+Alt key combinations on Windows. It is an alternative for AltGr.
+ if (keyboardDriver() == KeyboardDriver::Windows
+ && (qtModifiers & Qt::ControlModifier) && !(qtModifiers & Qt::AltModifier)) {
+ text.clear();
+ }
return text;
}