summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input
diff options
context:
space:
mode:
authorLibor Tomsik <libor@tomsik.eu>2013-03-19 19:15:25 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-20 10:09:28 +0100
commit27b4fe96b59e9e63d1e570e802c072e9afdfb2d4 (patch)
tree9975f2238c8ef133db6c5e6d672513240a5a7388 /src/platformsupport/input
parentd1f2309166295f2669df7d7f8ee996e35b35aa3c (diff)
Added configuration environment variables for evdev input plugins.
Added new environment parameters QT_QPA_EVDEV_KEYBOARD_PARAMETERS, QT_QPA_EVDEV_MOUSE_PARAMETERS and QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS to the evdevkeyboard, evdevmouse and evdevtouch input plugins. In order to get evdevkeyboard support for keyboard layout, explicit device file and more. Change-Id: I0d9139cd0d4b682ab2df7c16ebd16d4d9c0c0ab0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/platformsupport/input')
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp8
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp7
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch.cpp8
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch_p.h2
4 files changed, 21 insertions, 4 deletions
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
index 81acc161fe..4932087c5f 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
@@ -57,7 +57,13 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &
{
Q_UNUSED(key);
- QStringList args = specification.split(QLatin1Char(':'));
+
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_KEYBOARD_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
+ QStringList args = spec.split(QLatin1Char(':'));
QStringList devices;
foreach (const QString &arg, args) {
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index 415cffa4ae..6c430091c1 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -59,7 +59,12 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif
{
Q_UNUSED(key);
- QStringList args = specification.split(QLatin1Char(':'));
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_MOUSE_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
+ QStringList args = spec.split(QLatin1Char(':'));
QStringList devices;
foreach (const QString &arg, args) {
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
index 8c86eee469..2c93da147e 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
@@ -159,7 +159,7 @@ static inline bool testBit(long bit, const long *array)
return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1;
}
-QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &spec, QObject *parent)
+QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, QObject *parent)
: QObject(parent), m_notify(0), m_fd(-1), d(0)
#ifdef USE_MTDEV
, m_mtdev(0)
@@ -170,7 +170,13 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &spec, QObject
QString dev;
// only the first device argument is used for now
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
QStringList args = spec.split(QLatin1Char(':'));
+
for (int i = 0; i < args.count(); ++i) {
if (args.at(i).startsWith(QLatin1String("/dev/"))) {
dev = args.at(i);
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
index b4de2ca088..7e838c9134 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
@@ -63,7 +63,7 @@ class QEvdevTouchScreenHandler : public QObject
Q_OBJECT
public:
- explicit QEvdevTouchScreenHandler(const QString &spec = QString(), QObject *parent = 0);
+ explicit QEvdevTouchScreenHandler(const QString &specification = QString(), QObject *parent = 0);
~QEvdevTouchScreenHandler();
private slots: