diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-09-09 13:53:23 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-09-15 14:25:56 +0000 |
commit | 9ff7e7df0ff70f6ff576a9170e6f6c7a5bfce6f2 (patch) | |
tree | 1ead2583386d67bc294e5baba29bc9ecad5c0dab /src/plugins | |
parent | c3084f101d5ebb0719b2575663d2d3fdb9266005 (diff) |
winrt: Fix touch on Hololens
The pressure indicator is not handled for touch on the Hololens causing
touch heuristic to fail and not identify the press event.
Change-Id: I2aba95fde8aa9abfa3838cad6b3466ff8bc41811
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtscreen.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index ad32c046df..849acc2d3f 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -1094,6 +1094,12 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args) properties->get_IsLeftButtonPressed(&isPressed); // IsInContact not reliable on phone #endif + // Devices like the Hololens set a static pressure of 0.5 independent + // of the pressed state. In those cases we need to synthesize the + // pressure value. To our knowledge this does not apply to pens + if (pointerDeviceType == PointerDeviceType_Touch && pressure == 0.5f) + pressure = isPressed ? 1. : 0.; + const QRectF areaRect(area.X * d->scaleFactor, area.Y * d->scaleFactor, area.Width * d->scaleFactor, area.Height * d->scaleFactor); |