summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2018-07-27 09:35:33 +0200
committerOliver Wolff <oliver.wolff@qt.io>2018-07-27 08:35:51 +0000
commitadd0b0ea41fc7e8f73788288527511bb2c522975 (patch)
tree69740a44f9677e4bd9140fda9c6191d7f3240e60 /src
parent2e88340ad2943e3e95c6e6500c02dbb80b800c8c (diff)
Fix touch input for HoloLens devices
With newer HoloLens images every touch event has a pressure of 0.0. By checking both values we make sure that touch points are handled correctly for new and old images. Task-number: QTBUG-69651 Change-Id: Ic16e3416ffb7a89e4c1adbec1703e84aa962b211 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index 928fff32d6..e39a87148a 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -1250,10 +1250,11 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
boolean isPressed;
pointerPoint->get_IsInContact(&isPressed);
- // 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)
+ // Devices like the Hololens set a static pressure of 0.0 or 0.5
+ // (depending on the image) 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.0f || pressure == 0.5f))
pressure = isPressed ? 1. : 0.;
const QRectF areaRect(area.X * d->scaleFactor, area.Y * d->scaleFactor,