diff --git a/examples/widgets/mainwindows/mdi/mdi.pro b/examples/widgets/mainwindows/mdi/mdi.pro
index 2e3c232..839fc80 100644
--- a/examples/widgets/mainwindows/mdi/mdi.pro
+++ b/examples/widgets/mainwindows/mdi/mdi.pro
@@ -1,5 +1,5 @@
 QT += widgets
-
+CONFIG+=console
 HEADERS       = mainwindow.h \
                 mdichild.h
 SOURCES       = main.cpp \
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 770f847..ad0187d 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1944,8 +1944,10 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh
 
 void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e)
 {
+
     QWindow *window = e->window.data();
     modifier_buttons = e->modifiers;
+    qDebug() << __FUNCTION__ << window << e->modifiers;
     if (e->nullWindow()
 #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
            || e->key == Qt::Key_Back || e->key == Qt::Key_Menu
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index d17a1f1..1037a8b 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -242,13 +242,16 @@ bool QWindowSystemInterface::handleShortcutEvent(QWindow *window, ulong timestam
 }
 
 
-bool QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) {
+bool QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count)
+{
     unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
     return handleKeyEvent(w, time, t, k, mods, text, autorep, count);
 }
 
 bool QWindowSystemInterface::handleKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count)
 {
+    qDebug() << __FUNCTION__  << t << tlw << k << mods;
+
     if (t == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(tlw, timestamp, k, mods, 0, 0, 0, text, autorep, count))
         return true;
 
@@ -275,8 +278,11 @@ bool QWindowSystemInterface::handleExtendedKeyEvent(QWindow *tlw, ulong timestam
                                                     const QString& text, bool autorep,
                                                     ushort count, bool tryShortcutOverride)
 {
+    qDebug() << __FUNCTION__  << type << tlw << key << modifiers;
+
     if (tryShortcutOverride && type == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(tlw,
             timestamp, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count)) {
+        qDebug() << __FUNCTION__  << "over";
         return true;
     }
 
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index c5dff60..59dd4fc 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -823,6 +823,7 @@ static inline void sendExtendedPressRelease(QWindow *w, int k,
                                             bool autorep = false,
                                             ushort count = 1)
 {
+    qDebug() << __FUNCTION__ << w << k << mods << text;
     QWindowSystemInterface::handleExtendedKeyEvent(w, QEvent::KeyPress, k, mods, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count);
     QWindowSystemInterface::handleExtendedKeyEvent(w, QEvent::KeyRelease, k, mods, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count);
 }
@@ -858,7 +859,9 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd,
     if (PeekMessage(&peekedMsg, hwnd, 0, 0, PM_NOREMOVE) && peekedMsg.message == WM_DEADCHAR)
         return true;
 
-    return translateKeyEventInternal(widget, msg, false);
+    bool r = translateKeyEventInternal(widget, msg, false);
+    qDebug() << __FUNCTION__ << "translateKeyEventInternal returns" << r;
+    return r;
 }
 
 bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, const MSG &msg)
@@ -876,6 +879,7 @@ bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, con
         return false;
 
     const int qtKey = CmdTbl[cmd];
+    qDebug() << __FUNCTION__ << qtKey << Qt::KeyboardModifier(state);
     sendExtendedPressRelease(receiver, qtKey, Qt::KeyboardModifier(state), 0, 0, 0);
     // QTBUG-43343: Make sure to return false if Qt does not handle the key, otherwise,
     // the keys are not passed to the active media player.
@@ -889,12 +893,22 @@ bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, con
 
 bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &msg, bool /* grab */)
 {
+    static int n = 0;
+
     const int  msgType = msg.message;
 
     const quint32 scancode = (msg.lParam >> 16) & scancodeBitmask;
     quint32 vk_key = msg.wParam;
     quint32 nModifiers = 0;
 
+
+    qDebug() << __FUNCTION__ << '#' << n++
+              <<  hex << "MSG0x" << msg.message << "wParam=" << vk_key << "lp=" << msg.lParam;
+
+    if (vk_key >= VK_KANA && vk_key <= VK_KANJI) {
+        qDebug() << __FUNCTION__ << "VK_KANA ...vk_key <= VK_KANJI";
+    }
+
     QWindow *receiver = m_keyGrabber ? m_keyGrabber : window;
 
     // Map native modifiers to some bit representation
@@ -921,9 +935,12 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
     state |= (nModifiers & AltAny ? int(Qt::AltModifier) : 0);
     state |= (nModifiers & MetaAny ? int(Qt::MetaModifier) : 0);
 
+    qDebug() << __FUNCTION__ << hex << "nModifiers=" << nModifiers << state;
+
     // A multi-character key or a Input method character
     // not found by our look-ahead
     if (msgType == WM_CHAR || msgType == WM_IME_CHAR) {
+        qDebug() << __FUNCTION__ << "IME"  <<Qt::KeyboardModifier(state);
         sendExtendedPressRelease(receiver, 0, Qt::KeyboardModifier(state), scancode, vk_key, nModifiers, messageKeyText(msg), false);
         return true;
     }
@@ -986,6 +1003,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
     modifiersIndex |= (nModifiers & AltAny ? 0x4 : 0);
 
     int code = keyLayout[vk_key].qtKey[modifiersIndex];
+    qDebug() << "keyLayout[vk_key].qtKey[modifiersIndex]/code=" << hex << code;
 
     // Invert state logic:
     // If the key actually pressed is a modifier key, then we remove its modifier key from the
@@ -1144,6 +1162,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
         // so, we have an auto-repeating key
         if (rec) {
             if (code < Qt::Key_Shift || code > Qt::Key_ScrollLock) {
+                qDebug() << __FUNCTION__ << "k2" << hex << code << dec<< Qt::KeyboardModifier(state);
                 QWindowSystemInterface::handleExtendedKeyEvent(receiver, QEvent::KeyRelease, code,
                                                                Qt::KeyboardModifier(state), scancode, msg.wParam, nModifiers, rec->text, true);
                 QWindowSystemInterface::handleExtendedKeyEvent(receiver, QEvent::KeyPress, code,
@@ -1165,6 +1184,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
             }
 #endif // !QT_NO_SHORTCUT
             key_recorder.storeKey(msg.wParam, a, state, text);
+            qDebug() << __FUNCTION__ << "k1" << hex << code << dec << modifiers;
             QWindowSystemInterface::handleExtendedKeyEvent(receiver, QEvent::KeyPress, code,
                                                            modifiers, scancode, msg.wParam, nModifiers, text, false);
             result =true;
@@ -1202,12 +1222,15 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
                       || code == Qt::Key_Alt)) {
             // Someone ate the key down event
         } else {
+            qDebug() << __FUNCTION__ << "->" << hex << code << dec;
             if (!code)
                 code = asciiToKeycode(rec->ascii ? rec->ascii : msg.wParam, state);
+            qDebug() << __FUNCTION__ << " after asciiToKeycode ->" << hex << code << dec;
 
             // Map SHIFT + Tab to SHIFT + BackTab, QShortcutMap knows about this translation
             if (code == Qt::Key_Tab && (state & Qt::ShiftModifier) == Qt::ShiftModifier)
                 code = Qt::Key_Backtab;
+            qDebug() << __FUNCTION__ << "k3" << hex << code << dec << Qt::KeyboardModifier(state);
             QWindowSystemInterface::handleExtendedKeyEvent(receiver, QEvent::KeyRelease, code,
                                                            Qt::KeyboardModifier(state), scancode, msg.wParam, nModifiers,
                                                            (rec ? rec->text : QString()), false);
