diff --git a/gb.qt4/src/CWidget.cpp b/gb.qt4/src/CWidget.cpp index b5d952d81..9860f171e 100644 --- a/gb.qt4/src/CWidget.cpp +++ b/gb.qt4/src/CWidget.cpp @@ -2898,6 +2898,20 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event) { QKeyEvent *kevent = (QKeyEvent *)event; + if (MAIN_key_debug) + { +#ifdef QT5 + qDebug("gb.qt5" +#else + qDebug("gb.qt4" +#endif + ": %s: real = %d original = %d no_keyboard = %d", + (type == QEvent::KeyRelease ? "KeyRelease" : + type == QEvent::KeyPress ? "KeyPress" : + type == QEvent::InputMethod ? "InputMethod" : "?"), + real, original, control->flag.no_keyboard); + } + #if QT_VERSION <= 0x030005 if (!real || !original) goto _DESIGN; diff --git a/gb.qt4/src/main.cpp b/gb.qt4/src/main.cpp index 681217034..fed115952 100644 --- a/gb.qt4/src/main.cpp +++ b/gb.qt4/src/main.cpp @@ -131,6 +131,7 @@ int MAIN_x11_last_key_code = 0; #endif bool MAIN_debug_busy = false; bool MAIN_init = false; +bool MAIN_key_debug = false; GB_CLASS CLASS_Control; GB_CLASS CLASS_Container; @@ -875,6 +876,7 @@ static void QT_Init(void) { static bool init = false; QFont f; + char *env; if (init) return; @@ -890,7 +892,7 @@ static void QT_Init(void) if (::strcmp(qApp->style()->metaObject()->className(), "Breeze::Style") == 0) { - char *env = getenv("GB_QT_NO_BREEZE_FIX"); + env = getenv("GB_QT_NO_BREEZE_FIX"); if (!env || atoi(env) == 0) { CSTYLE_fix_breeze = TRUE; @@ -899,7 +901,7 @@ static void QT_Init(void) } else if (::strcmp(qApp->style()->metaObject()->className(), "Oxygen::Style") == 0) { - char *env = getenv("GB_QT_NO_OXYGEN_FIX"); + env = getenv("GB_QT_NO_OXYGEN_FIX"); if (!env || atoi(env) == 0) { CSTYLE_fix_oxygen = TRUE; @@ -928,6 +930,10 @@ static void QT_Init(void) MyApplication::initClipboard(); + env = getenv("GB_QT_KEY_DEBUG"); + if (env && atoi(env) != 0) + MAIN_key_debug = TRUE; + init = true; } diff --git a/gb.qt4/src/main.h b/gb.qt4/src/main.h index 922dc1be8..6cf6ca28c 100644 --- a/gb.qt4/src/main.h +++ b/gb.qt4/src/main.h @@ -51,6 +51,7 @@ extern int MAIN_loop_level; extern int MAIN_scale; extern bool MAIN_debug_busy; extern bool MAIN_init; +extern bool MAIN_key_debug; #ifndef NO_X_WINDOW extern int MAIN_x11_last_key_code; #endif