Skip to content

Commit fd48394

Browse files
committed
Fix AltGr on Windows
Fixes: QTBUG-83710 Change-Id: Iaf5a33c0aeb53348d36cb7dda60602041299cd50 Reviewed-by: Allan Sandfeld Jensen <[email protected]> (cherry picked from commit 53498cb)
1 parent 09015f8 commit fd48394

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core/web_event_factory.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,15 @@ static QString qtTextForKeyEvent(const QKeyEvent *ev, int qtKey, Qt::KeyboardMod
171171
{
172172
QString text = ev->text();
173173

174-
if ((qtModifiers & Qt::ControlModifier) && keyboardDriver() == KeyboardDriver::Xkb)
174+
if (keyboardDriver() == KeyboardDriver::Xkb && (qtModifiers & Qt::ControlModifier)) {
175175
text.clear();
176+
}
177+
178+
// Keep text for Ctrl+Alt key combinations on Windows. It is an alternative for AltGr.
179+
if (keyboardDriver() == KeyboardDriver::Windows
180+
&& (qtModifiers & Qt::ControlModifier) && !(qtModifiers & Qt::AltModifier)) {
181+
text.clear();
182+
}
176183

177184
return text;
178185
}

0 commit comments

Comments
 (0)