Forward native key codes to QWindowSystemInterface
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>
Thu, 29 Mar 2012 08:54:29 +0000 (10:54 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 30 Mar 2012 19:51:14 +0000 (21:51 +0200)
Using QWindowSystemInterface::handleExtendedKeyEvent() instead of
QWindowSystemInterface::handleKeyEvent(). While the former allows
us to forward the native key codes to QWindowSystemInterface, the
latter initializes them with 0, causing QKeyEvent::native*() to
return 0, instead of the actual values.

Change-Id: I596ad2e07645e091529ca514682c98d095244a73
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp

index 9ac5ca4..46780b6 100644 (file)
@@ -160,7 +160,8 @@ void QQnxScreenEventHandler::injectKeyboardEvent(int flags, int sym, int modifie
             key = keyTranslator(cap);
         }
 
-        QWindowSystemInterface::handleKeyEvent(QGuiApplication::focusWindow(), type, key, qtMod, keyStr);
+        QWindowSystemInterface::handleExtendedKeyEvent(QGuiApplication::focusWindow(), type, key, qtMod,
+                scan, sym, modifiers, keyStr);
 #if defined(QQNXSCREENEVENT_DEBUG)
         qDebug() << "QQNX: Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
 #endif