diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-13 11:37:37 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-13 11:37:37 (GMT) |
commit | 5a8078cb2cf1c95e8d853b9b0bd8c8303f52aceb (patch) | |
tree | e78c20875d3ca9257c3dcc64b7dcf5799bc65cb5 | |
parent | 0cb3705195b54f199280ab0b8554c793f67425e2 (diff) | |
download | Qt-5a8078cb2cf1c95e8d853b9b0bd8c8303f52aceb.zip Qt-5a8078cb2cf1c95e8d853b9b0bd8c8303f52aceb.tar.gz Qt-5a8078cb2cf1c95e8d853b9b0bd8c8303f52aceb.tar.bz2 |
Add touch offset
-rw-r--r-- | src/plugins/generic/linuxinput/qlinuxinput.cpp | 8 | ||||
-rw-r--r-- | src/plugins/generic/linuxinput/qlinuxinput.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/generic/linuxinput/qlinuxinput.cpp b/src/plugins/generic/linuxinput/qlinuxinput.cpp index 07f7a43..b3ef6bd 100644 --- a/src/plugins/generic/linuxinput/qlinuxinput.cpp +++ b/src/plugins/generic/linuxinput/qlinuxinput.cpp @@ -131,7 +131,7 @@ private: QLinuxInputMouseHandler::QLinuxInputMouseHandler(const QString &key, const QString &specification) - : m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0), m_buttons(0), d(0) + : m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0), m_xoffset(0), m_yoffset(0), m_buttons(0), d(0) { qDebug() << "QLinuxInputMouseHandler" << key << specification; @@ -149,6 +149,10 @@ QLinuxInputMouseHandler::QLinuxInputMouseHandler(const QString &key, m_compression = false; else if (arg.startsWith("dejitter=")) jitterLimit = arg.mid(9).toInt(); + else if (arg.startsWith("xoffset=")) + m_xoffset = arg.mid(8).toInt(); + else if (arg.startsWith("yoffset=")) + m_yoffset = arg.mid(8).toInt(); else if (arg.startsWith(QLatin1String("/dev/"))) dev = arg; } @@ -179,7 +183,7 @@ QLinuxInputMouseHandler::~QLinuxInputMouseHandler() void QLinuxInputMouseHandler::sendMouseEvent(int x, int y, Qt::MouseButtons buttons) { - QPoint pos(x, y); + QPoint pos(x+m_xoffset, y+m_yoffset); QWindowSystemInterface::handleMouseEvent(0, pos, pos, m_buttons); m_prevx = x; m_prevy = y; diff --git a/src/plugins/generic/linuxinput/qlinuxinput.h b/src/plugins/generic/linuxinput/qlinuxinput.h index 37123f1..c94c0f4 100644 --- a/src/plugins/generic/linuxinput/qlinuxinput.h +++ b/src/plugins/generic/linuxinput/qlinuxinput.h @@ -70,6 +70,7 @@ private: int m_fd; int m_x, m_y; int m_prevx, m_prevy; + int m_xoffset, m_yoffset; int m_smoothx, m_smoothy; Qt::MouseButtons m_buttons; bool m_compression; |