diff options
author | Andrew Gatt <andrew.gatt@springltd.co> | 2014-03-24 14:15:23 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-24 20:25:45 +0100 |
commit | 1d4a1be1af8ba3cd1965da0e32754067d2a6d1f6 (patch) | |
tree | 7ea1129a9b90893a4cffa87fa3dce94426429d11 /src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h | |
parent | c79918733a194ebbe5a2fe1617c884659f3e4b9f (diff) |
Add: absolute touch screen handling in evdevmouse
Some touch screen drivers present themselves as mice with absolute
coordinates. Setting QT_QPA_EVDEV_MOUSE_PARAMETERS=abs will force
qevdevmousehandler to use absolute coordinates, mapped to the screen
from the hardware maximums. These maximum values are read from the
driver using ioctls.
This feature can be safely used with mice, as the features checks will
fail and qevdevmouse will revert back to using relative coordinates.
This way touch screens and mice can work together.
Change-Id: Ic27bda02aa2199f008bac26db75c1f896696f9f5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h')
-rw-r--r-- | src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h index d419a1913e..027d2862b0 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h +++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h @@ -57,26 +57,32 @@ public: ~QEvdevMouseHandler(); signals: - void handleMouseEvent(int x, int y, Qt::MouseButtons buttons); + void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons); void handleWheelEvent(int delta, Qt::Orientation orientation); private slots: void readMouseData(); private: - QEvdevMouseHandler(const QString &device, int fd, bool compression, int jitterLimit); + QEvdevMouseHandler(const QString &device, int fd, bool abs, bool compression, int jitterLimit); void sendMouseEvent(); + bool getHardwareMaximum(); QString m_device; int m_fd; QSocketNotifier *m_notify; int m_x, m_y; int m_prevx, m_prevy; + bool m_abs; bool m_compression; Qt::MouseButtons m_buttons; int m_jitterLimitSquared; bool m_prevInvalid; + int m_hardwareWidth; + int m_hardwareHeight; + qreal m_hardwareScalerY; + qreal m_hardwareScalerX; }; QT_END_NAMESPACE |