diff options
| author | Michael Brasser <mbrasser@ford.com> | 2018-01-16 11:44:37 -0600 |
|---|---|---|
| committer | Michael Brasser <michael.brasser@live.com> | 2018-01-17 15:39:56 +0000 |
| commit | 235150a1909b9d666acbdb541c665a19cc474c01 (patch) | |
| tree | e429a0bffc2c2b2f98e1fcc3a211761906b4911c /src/plugins/platforms/webgl/qwebglintegration.cpp | |
| parent | be486076d4c6afdeae655ef66a2d007bed1cbbb2 (diff) | |
Qt's other platform plugins differentiate Key_Enter and Key_Return.
Update the webgl plugin to do the same.
Also remove unused code related to key mapping.
Task-number: QTBUG-65686
Change-Id: I9e65b9413828f713f56d4942531f120b7d9cc6d7
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Diffstat (limited to 'src/plugins/platforms/webgl/qwebglintegration.cpp')
| -rw-r--r-- | src/plugins/platforms/webgl/qwebglintegration.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/webgl/qwebglintegration.cpp b/src/plugins/platforms/webgl/qwebglintegration.cpp index 8c17190..4305253 100644 --- a/src/plugins/platforms/webgl/qwebglintegration.cpp +++ b/src/plugins/platforms/webgl/qwebglintegration.cpp @@ -628,6 +628,13 @@ void QWebGLIntegrationPrivate::handleKeyboard(const ClientData &clientData, if (specialKey != keyMap.end()) { key = *specialKey; string.clear(); + + // special case: match Qt's behavior on other platforms and differentiate: + // * "Enter": Qt::Key_Return + // * "NumpadEnter": Qt::Key_Enter + // TODO: consider whether "code" could be used rather than "keyName" above + if (key == Qt::Key_Enter && object.value("code").toString() == QStringLiteral("Enter")) + key = Qt::Key_Return; } const auto window = clientData.platformWindows.last()->window(); |
