diff --git a/src/gui/kernel/qkeymapper.cpp b/src/gui/kernel/qkeymapper.cpp index 76ec7eba0dd..d62ff5657b0 100644 --- a/src/gui/kernel/qkeymapper.cpp +++ b/src/gui/kernel/qkeymapper.cpp @@ -37,6 +37,8 @@ QKeyMapper::~QKeyMapper() QList QKeyMapper::possibleKeys(const QKeyEvent *e) { + qCDebug(lcQpaKeyMapper).verbosity(3) << "Computing possible key combinations for" << e; + const auto *platformIntegration = QGuiApplicationPrivate::platformIntegration(); const auto *platformKeyMapper = platformIntegration->keyMapper(); QList result = platformKeyMapper->possibleKeyCombinations(e); @@ -48,6 +50,16 @@ QList QKeyMapper::possibleKeys(const QKeyEvent *e) result << (Qt::Key(e->text().at(0).unicode()) | e->modifiers()); } + if (lcQpaKeyMapper().isDebugEnabled()) { + qCDebug(lcQpaKeyMapper) << "Resulting possible key combinations:"; + for (auto keyCombination : result) { + auto keySequence = QKeySequence(keyCombination); + qCDebug(lcQpaKeyMapper).verbosity(0) << "\t-" + << keyCombination << "/" << keySequence << "/" + << qUtf8Printable(keySequence.toString(QKeySequence::NativeText)); + } + } + return result; } diff --git a/src/gui/platform/darwin/qapplekeymapper.mm b/src/gui/platform/darwin/qapplekeymapper.mm index 7aefe64c6a5..944ae424b59 100644 --- a/src/gui/platform/darwin/qapplekeymapper.mm +++ b/src/gui/platform/darwin/qapplekeymapper.mm @@ -541,8 +541,6 @@ QList QAppleKeyMapper::possibleKeyCombinations(const QKeyEvent { QList ret; - qCDebug(lcQpaKeyMapper) << "Computing possible keys for" << event; - const auto nativeVirtualKey = event->nativeVirtualKey(); if (!nativeVirtualKey) return ret; @@ -579,16 +577,6 @@ QList QAppleKeyMapper::possibleKeyCombinations(const QKeyEvent } } - if (lcQpaKeyMapper().isDebugEnabled()) { - qCDebug(lcQpaKeyMapper) << "Possible keys:"; - for (auto keyCombination : ret) { - auto keySequence = QKeySequence(keyCombination); - qCDebug(lcQpaKeyMapper).verbosity(0) << "\t-" - << keyCombination << "/" << keySequence << "/" - << qUtf8Printable(keySequence.toString(QKeySequence::NativeText)); - } - } - return ret; }