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>
This commit is contained in:
Maurice Kalinowski 2016-09-09 13:53:23 +02:00
parent c3084f101d
commit 9ff7e7df0f

View File

@ -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);