summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/linuxfb
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/linuxfb')
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp33
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.h5
2 files changed, 37 insertions, 1 deletions
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
index b0d99e80c1..1600ee3f2b 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
@@ -46,6 +46,16 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
+#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
+#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
+#include <QtPlatformSupport/private/qevdevtouch_p.h>
+#endif
+
+#if !defined(QT_NO_TSLIB) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+#include <QtPlatformSupport/private/qtslib_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
QLinuxFbIntegration::QLinuxFbIntegration(const QStringList &paramList)
@@ -70,6 +80,9 @@ void QLinuxFbIntegration::initialize()
m_inputContext = QPlatformInputContextFactory::create();
m_vtHandler.reset(new QFbVtHandler);
+
+ if (!qEnvironmentVariableIntValue("QT_QPA_FB_DISABLE_INPUT"))
+ createInputHandlers();
}
bool QLinuxFbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
@@ -113,4 +126,24 @@ QPlatformServices *QLinuxFbIntegration::services() const
return m_services.data();
}
+void QLinuxFbIntegration::createInputHandlers()
+{
+#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+ new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this);
+ QEvdevMouseManager *mouseMgr = new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this);
+ Q_FOREACH (QScreen *screen, QGuiApplication::screens()) {
+ QFbCursor *cursor = qobject_cast<QFbCursor *>(screen->handle()->cursor());
+ if (cursor)
+ cursor->setMouseDeviceDiscovery(mouseMgr->deviceDiscovery());
+ }
+#ifndef QT_NO_TSLIB
+ const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB");
+ if (useTslib)
+ new QTsLibMouseHandler(QLatin1String("TsLib"), QString());
+ else
+#endif // QT_NO_TSLIB
+ new QEvdevTouchScreenHandlerThread(QString(), this);
+#endif
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
index cabd943921..3e7e1c57f4 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
@@ -35,6 +35,7 @@
#define QLINUXFBINTEGRATION_H
#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
@@ -42,7 +43,7 @@ class QAbstractEventDispatcher;
class QLinuxFbScreen;
class QFbVtHandler;
-class QLinuxFbIntegration : public QPlatformIntegration
+class QLinuxFbIntegration : public QPlatformIntegration, public QPlatformNativeInterface
{
public:
QLinuxFbIntegration(const QStringList &paramList);
@@ -63,6 +64,8 @@ public:
QList<QPlatformScreen *> screens() const;
private:
+ void createInputHandlers();
+
QLinuxFbScreen *m_primaryScreen;
QPlatformInputContext *m_inputContext;
QScopedPointer<QPlatformFontDatabase> m_fontDb;