diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-03-13 15:33:44 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-03-17 12:10:23 +0000 |
commit | 8aeed99d77b8876d42e19be7123142e5fe2d2a78 (patch) | |
tree | b0152437f07386398ca3867e3d2337942229888f /src/plugins/platforms/windows/qwindowstabletsupport.h | |
parent | ff1630ab0e1d4bf80580a3cc1852ac4450351133 (diff) |
Windows QPA: Improve tablet mode detection
Change the code to detect mouse mode only the first packet after
receiving the enter proximity event, using the current tablet
position. This should prevent mis-detecting mouse mode due to lags, etc.
There is a theoretical chance of failing to detect mouse mode should the
positions match resulting in differing speeds of mouse/tablet positions, but
this seems to be a negligible risk.
Task-number: QTBUG-36937
Task-number: QTBUG-64781
Change-Id: I27ca4a17786164dc8b25c4614a88672e150d5fe3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstabletsupport.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowstabletsupport.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.h b/src/plugins/platforms/windows/qwindowstabletsupport.h index 7878e962e1..340818c3f7 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.h +++ b/src/plugins/platforms/windows/qwindowstabletsupport.h @@ -112,6 +112,19 @@ class QWindowsTabletSupport explicit QWindowsTabletSupport(HWND window, HCTX context); public: + enum Mode + { + PenMode, + MouseMode + }; + + enum State + { + PenUp, + PenProximity, + PenDown + }; + ~QWindowsTabletSupport(); static QWindowsTabletSupport *create(); @@ -137,6 +150,8 @@ private: QVector<QWindowsTabletDeviceData> m_devices; int m_currentDevice; QPointF m_oldGlobalPosF; + Mode m_mode = PenMode; + State m_state = PenUp; }; QT_END_NAMESPACE |