summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qmultitouch_mac_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-09-12 17:07:54 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2017-09-21 16:35:14 +0000
commitaa4ff7b2e9d4523dbc44afad98a4e3570ec6a997 (patch)
treea768745c8901b136fe4bee9db85c5183e7e98226 /src/plugins/platforms/cocoa/qmultitouch_mac_p.h
parent83729ad7a1e2d9c75ddf7238ab7c91b514dcebcf (diff)
macOS touch and gestures: pay attention to deviceID
Previously we pretended that there is only one touch device; but in fact, different trackpads have different deviceIDs, and this may be useful in some scenarios to tell them apart, as on other platforms. So far we don't expect to get touch events from actual touchscreens though, because macOS only turns single-touch events into mouse events and does not interpret gestures on touchscreens. So there isn't API which can distinguish touchscreens from touchpads as far as we know. QCocoaTouch::getTouchDevice() takes the type as a parameter, just in case this changes some day. Change-Id: I56228471363235c5d0cc2a55a35a3c3288f3b1a1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qmultitouch_mac_p.h')
-rw-r--r--src/plugins/platforms/cocoa/qmultitouch_mac_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac_p.h b/src/plugins/platforms/cocoa/qmultitouch_mac_p.h
index 77af86c9c7..044bcd1882 100644
--- a/src/plugins/platforms/cocoa/qmultitouch_mac_p.h
+++ b/src/plugins/platforms/cocoa/qmultitouch_mac_p.h
@@ -66,8 +66,10 @@ class QCocoaTouch
public:
static QList<QWindowSystemInterface::TouchPoint> getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch);
static void setMouseInDraggingState(bool inDraggingState);
+ static QTouchDevice *getTouchDevice(QTouchDevice::DeviceType type, quint64 id);
private:
+ static QHash<quint64, QTouchDevice*> _touchDevices;
static QHash<qint64, QCocoaTouch*> _currentTouches;
static QPointF _screenReferencePos;
static QPointF _trackpadReferencePos;