diff --git a/src/gui/kernel/qkeymapper.cpp b/src/gui/kernel/qkeymapper.cpp
index 4893b1d57b..1d3ff2833e 100644
--- a/src/gui/kernel/qkeymapper.cpp
+++ b/src/gui/kernel/qkeymapper.cpp
@@ -42,7 +42,7 @@
 
 #include <private/qobject_p.h>
 #include "qkeymapper_p.h"
-
+#include <qdebug.h>
 #include <private/qguiapplication_p.h>
 #include <qpa/qplatformintegration.h>
 
@@ -135,7 +135,18 @@ void QKeyMapperPrivate::clearMappings()
 
 QList<int> QKeyMapperPrivate::possibleKeys(QKeyEvent *e)
 {
+    qDebug() << __FUNCTION__ << e;
     QList<int> result = QGuiApplicationPrivate::platformIntegration()->possibleKeys(e);
+    {
+        QDebug d = qDebug() ;
+        d<<  __FUNCTION__ << "rets (";
+        for (int k : result)  {
+            if (Qt::KeyboardModifiers mods  = Qt::KeyboardModifiers(k & Qt::KeyboardModifierMask))
+                d << mods << '+';
+            d << Qt::Key(k & ~Qt::KeyboardModifierMask) << ' ';
+        }
+        d << ')';
+    }
     if (!result.isEmpty())
         return result;
 
diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp
index 6c19eab287..b67233c841 100644
--- a/src/gui/kernel/qshortcutmap.cpp
+++ b/src/gui/kernel/qshortcutmap.cpp
@@ -53,7 +53,7 @@
 QT_BEGIN_NAMESPACE
 
 // To enable verbose output uncomment below
-//#define DEBUG_QSHORTCUTMAP
+#define DEBUG_QSHORTCUTMAP
 
 /* \internal
     Entry data for QShortcutMap
@@ -539,6 +539,7 @@ void QShortcutMap::clearSequence(QVector<QKeySequence> &ksl)
 void QShortcutMap::createNewSequences(QKeyEvent *e, QVector<QKeySequence> &ksl, int ignoredModifiers)
 {
     Q_D(QShortcutMap);
+    qDebug() << __FUNCTION__ << e << ksl << "ignoredModifiers=" << ignoredModifiers;
     QList<int> possibleKeys = QKeyMapper::possibleKeys(e);
     int pkTotal = possibleKeys.count();
     if (!pkTotal)
@@ -569,6 +570,7 @@ void QShortcutMap::createNewSequences(QKeyEvent *e, QVector<QKeySequence> &ksl,
             curKsl.setKey(possibleKeys.at(pkNum) & ~ignoredModifiers, index);
         }
     }
+    qDebug() << __FUNCTION__ << "rets" <<ksl;
 }
 
 /*! \internal
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 2e44626112..60c2dec90f 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -50,6 +50,7 @@
 #include <private/qhighdpiscaling_p.h>
 #include <QtGui/QKeyEvent>
 #include <QtEventDispatcherSupport/private/qwindowsguieventdispatcher_p.h>
+#include <QtCore/private/qdebug_p.h>
 
 #if defined(WM_APPCOMMAND)
 #  ifndef FAPPCOMMAND_MOUSE
@@ -81,6 +82,7 @@
 #  endif
 #endif
 
+
 QT_BEGIN_NAMESPACE
 
 /*!
@@ -543,6 +545,59 @@ static const Qt::KeyboardModifiers ModsTbl[] = {
 static const size_t NumMods = sizeof ModsTbl / sizeof *ModsTbl;
 Q_STATIC_ASSERT((NumMods == KeyboardLayoutItem::NumQtKeys));
 
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const KeyboardLayoutItem &k)
+{
+    QDebugStateSaver saver(d);
+    d.nospace();
+    d << "KeyboardLayoutItem(";
+    if (k.exists) {
+        for (size_t i = 0; i < NumMods; ++i) {
+            if (const quint32 qtKey = k.qtKey[i]) {
+                d << '[' << i << ' ';
+                QtDebugUtils::formatQFlags(d, ModsTbl[i]);
+                d << ' ' << hex << showbase << qtKey << dec << noshowbase << ' ';
+                QtDebugUtils::formatQEnum(d, Qt::Key(qtKey));
+                if (qtKey >= 32 && qtKey < 128)
+                    d << " '" << char(qtKey)  << '\'';
+                if (k.deadkeys & (1<<i))
+                    d << "  deadkey";
+                d << "] ";
+            }
+        }
+    }
+    d << ')';
+    return d;
+}
+
+// Helpers to format a list of int as Qt key sequence
+class formatKeys
+{
+public:
+    explicit formatKeys(const QList<int> &keys) : m_keys(keys) {}
+
+private:
+    friend QDebug operator<<(QDebug d, const formatKeys &keys);
+    const QList<int> &m_keys;
+};
+
+QDebug operator<<(QDebug d, const formatKeys &k)
+{
+    QDebugStateSaver saver(d);
+    d.nospace();
+    d << '(';
+    for (int i =0, size = k.m_keys.size(); i < size; ++i) {
+        if (i)
+            d << ", ";
+        d << QKeySequence(k.m_keys.at(i));
+    }
+    d << ')';
+    return d;
+}
+#else // !QT_NO_DEBUG_STREAM
+static int formatKeys(const QList<int> &) { return 0; }
+#endif // QT_NO_DEBUG_STREAM
+
 /**
   Remap return or action key to select key for windows mobile.
 */
@@ -721,6 +776,10 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32
         ::ToAscii(VK_SPACE, 0, emptyBuffer, reinterpret_cast<LPWORD>(&buffer), 0);
         ::ToAscii(vk_key, scancode, kbdBuffer, reinterpret_cast<LPWORD>(&buffer), 0);
     }
+
+    qDebug() << __FUNCTION__ << "for virtual key="
+             << hex << showbase << vk_key << dec << noshowbase << keyLayout[vk_key];
+
     if (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) {
         QString message;
         QDebug debug(&message);
@@ -1283,6 +1342,10 @@ QList<int> QWindowsKeyMapper::possibleKeys(const QKeyEvent *e) const
         }
     }
 
+    qDebug() << __FUNCTION__  << e << "nativeVirtualKey="
+           << showbase << hex << e->nativeVirtualKey() << dec << noshowbase
+           << e->modifiers() << kbItem << "\n  returns" << formatKeys(result);
+
     return result;
 }
 
