diff --git a/examples/mainwindows/mdi/mdi.pro b/examples/mainwindows/mdi/mdi.pro
index 90c103a..86f46db 100644
--- a/examples/mainwindows/mdi/mdi.pro
+++ b/examples/mainwindows/mdi/mdi.pro
@@ -4,7 +4,7 @@ SOURCES       = main.cpp \
                 mainwindow.cpp \
                 mdichild.cpp
 RESOURCES     = mdi.qrc
-
+CONFIG+=console
 # install
 target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/mdi
 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mdi.pro images
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 276d73a..2bea410 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -2295,6 +2295,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
 #ifndef QT_NO_CONTEXTMENU
             case WM_CONTEXTMENU:
             {
+            qDebug() << "WM_CONTEXTMENU";
                 // it's not VK_APPS or Shift+F10, but a click in the NC area
                 if (lParam != (int)0xffffffff) {
                     result = false;
@@ -2695,6 +2696,8 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
 
 do_default:
 #ifndef QT_NO_IM
+    if (msg.message == WM_KEYUP)
+        qDebug() << "RETURN(false);";
     RETURN(QWinInputContext::DefWindowProc(hwnd,message,wParam,lParam))
 #else
     RETURN(TRUE);
diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h
index 166734b..e7154c6 100644
--- a/src/gui/kernel/qkeymapper_p.h
+++ b/src/gui/kernel/qkeymapper_p.h
@@ -158,6 +158,7 @@ public:
 #if defined(Q_OS_WIN)
     void clearRecordedKeys();
     void updateKeyMap(const MSG &msg);
+    bool translateKeyEventI(QWidget *receiver, const MSG &msg, bool grab);
     bool translateKeyEvent(QWidget *receiver, const MSG &msg, bool grab);
     void updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 scancode, quint32 vk_key);
     bool isADeadKey(unsigned int vk_key, unsigned int modifiers);
diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp
index b8ad501..fc49a00 100644
--- a/src/gui/kernel/qkeymapper_win.cpp
+++ b/src/gui/kernel/qkeymapper_win.cpp
@@ -799,7 +799,15 @@ QList<int> QKeyMapperPrivate::possibleKeys(QKeyEvent *e)
     return result;
 }
 
-bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool grab)
+bool QKeyMapperPrivate::translateKeyEvent(QWidget *receiver, const MSG &msg, bool grab)
+{
+    bool r = translateKeyEventI(receiver, msg, grab);
+    qDebug() << __FUNCTION__ << receiver << grab << "msg0x" << hex << msg.message << dec
+             << "ret" << r;
+    return r;
+}
+
+bool QKeyMapperPrivate::translateKeyEventI(QWidget *widget, const MSG &msg, bool grab)
 {
     Q_Q(QKeyMapper);
     Q_UNUSED(q); // Strange, but the compiler complains on q not being referenced, even if it is..
@@ -1091,6 +1099,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool
             // so, we have an auto-repeating key
             if (rec) {
                 if (code < Qt::Key_Shift || code > Qt::Key_ScrollLock) {
+                    qDebug() << __FUNCTION__ << '1' << rec->text;
                     k0 = q->sendKeyEvent(widget, grab, QEvent::KeyRelease, code,
                                          Qt::KeyboardModifier(state), rec->text, true, 0,
                                          scancode, msg.wParam, nModifiers);
@@ -1107,6 +1116,9 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool
                     text += uch;
                 char a = uch.row() ? 0 : uch.cell();
                 key_recorder.storeKey(msg.wParam, a, state, text);
+                const bool sf10 =  (state == Qt::SHIFT && code == Qt::Key_F10);
+                qDebug() << __FUNCTION__ << '2' << state << code << text
+                << "SHIFT-F10" << sf10;
                 k0 = q->sendKeyEvent(widget, grab, QEvent::KeyPress, code, Qt::KeyboardModifier(state),
                                      text, false, 0, scancode, msg.wParam, nModifiers);
 
@@ -1150,6 +1162,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool
                 // 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__ << '3' << (rec ? rec->text : QString());
 
                 k0 = q->sendKeyEvent(widget, grab, QEvent::KeyRelease, code, Qt::KeyboardModifier(state),
                                      (rec ? rec->text : QString()), false, 0, scancode, msg.wParam, nModifiers);
